Follow up to PR 41137. Using the Intel compiler, the following program takes 0s for the loops (real time: 0.005s); however, with gfortran -fdump-tree-original -fwhole-program -flto -ffast-math -march=native -O3 cont.f90 GCC needs 1.142s.
Expected: * GCC also optimizes the loops away if the variable "a" is never read (but only set) Removing the !! comments prevents ifort from optimizing the loops away; still the performance is with (real time) 0.650s twice as good as the one of GCC. -- Summary: -flto -fwhole-program: Never read variable not optimized away Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44612