http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51125
--- Comment #5 from Patrick Marlier <patrick.marlier at gmail dot com> 2011-11-19 17:42:20 UTC --- ** NOT RELATED TO BUG ** In http://gcc.gnu.org/ml/gcc-patches/2011-11/msg00969.html, the patch shows changes to tree-ssa-reassoc.c but not committed or part of Changelog. But the problem is definitely not here. Patrick. Index: tree-ssa-reassoc.c =================================================================== --- tree-ssa-reassoc.c.orig 2011-11-07 15:56:25.000000000 +0100 +++ tree-ssa-reassoc.c 2011-11-07 16:12:35.000000000 +0100 @@ -2869,6 +2869,12 @@ reassociate_bb (basic_block bb) rhs1 = gimple_assign_rhs1 (stmt); rhs2 = gimple_assign_rhs2 (stmt); + /* We don't want to destroy reduction like patterns + with reassociation, simply don't start at such + statements. */ + if (is_phi_for_stmt (stmt, rhs1) || is_phi_for_stmt (stmt, rhs2)) + continue; + /* For non-bit or min/max operations we can't associate all types. Verify that here. */ if (rhs_code != BIT_IOR_EXPR