------- Comment #20 from ubizjak at gmail dot com 2010-01-07 07:29 ------- (In reply to comment #19) > > Following patch changes the fix from PR21767 to remove REG_EQUAL notes from > > all > > moved instructions, not only from ones that have non-function-invariant > > sources. > > This seems like a tad aggressive. Why not remove the REG_EQUAL note after the > constant propagation has happened instead?
Because at the point of propagation, propagated constant _is_ equal to whatever REG_EQUAL says. Removing this note at the point of propagation would IMO disable much more optimization opportunities. BTW: This fixup happens in very rare occasions. Although the loop looks scary, it usually processes very small BBs (I didn't found the case where more than one assignment was moved at the top of the test BB. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42511