News for hackers. Stuff that matters.
Re:Intel Fortran now 20% faster than C, fastest language on ... by gcp on Thursday January 12, 2012 @09:14AM (#3456344)
How does this matter when the compiler can see all the source code? It can see what the pointers are pointing to and determine if there is aliasing.

Feel free to point out the source code in the shootout where this would somehow not be the case. Shouldn't be hard to find if you focus on the benchmarks where Fortran beats C heavily.

Additionally, the argument about restrict is flawed because it can be added to the C code too, so it can't be an advantage of Fortran.

Re:Intel Fortran now 20% faster than C, fastest language on ... by xyzzyz on Thursday January 12, 2012 @09:42AM (#3456452)
It is impossible write a compiler that reads a C source code and for every point in program decides if two names visible from that point cannot alias each other. You cannot do that even under assumption that every code path may be visited.
Re:Intel Fortran now 20% faster than C, fastest language on ... by gcp on Thursday January 12, 2012 @10:05AM (#3456524)
I agree it is impossible in the general case (it's obviously impossible when input data controls program flow, for example). But I don't think that has much meaning for the benchmarks under consideration, which, by the way, one would expect to sidestep the obvious pitfalls here.

The impossibility of solving aliasing in the general case doesn't stop C compiler writers from implementing alias analysis.

Re:Intel Fortran now 20% faster than C, fastest language on ... by shasta on Thursday January 12, 2012 @10:31AM (#3456627)
I assume xyzzyz was referring to the undecidability of the halting problem, not just user input. Comparisons to the halting problem are often made inappropriately, as would be the case here, since the compiler doesn't need to answer whether an arbitrary program contains aliasing, but only identify programs that admit arguments (often simple ones) demonstrating that they don't alias. It's still undecidable, though.
Re:Intel Fortran now 20% faster than C, fastest language on ... by figglesonrails on Thursday January 12, 2012 @12:18PM (#3457081)
void* p1; void* p2;

p2 = function(p1);

Do p1 and p2 alias? Note: function() is in a *.so file, no source available.

How many times do you have all of the source code available for analysis?

Re:Intel Fortran now 20% faster than C, fastest language on ... by gcp on Thursday January 12, 2012 @12:33PM (#3457152)
I pointed out specifically that all source code is available exactly for this reason. The original claim was that "for Fortran this is expected" which isn't true at all in this condition. So aliasing information can't explain the performance difference.