The attached testcase is pessimized by PRE. Be sure to get tree-level complete loop unrolling enabled, f.i. with -O2 -funroll-loops with current mainline.
With PRE, a lot less computations are hoisted out of the inner loop. Note this is not a regression to 3.4, which is not able to decompose Loc<Dim> appropriately or avoid instantiating temporary objects of this type. -- Summary: PRE pessimizes ivopts Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at tat dot physik dot uni-tuebingen dot de CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19624