http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49069
Steven Bosscher <steven at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |steven at gcc dot gnu.org Component|target |tree-optimization Known to work| |4.7.0 Known to fail|4.7.0 |4.6.3 --- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> 2012-03-01 18:00:55 UTC --- (In reply to comment #4) > The real question is why is a cstore operation being called with constants for > the two operands in the comparison. If it knows the constants, then it knows > the result of the comparison and can collapse the entire result. That is because "GCC: (GNU) 4.6.3" fails to fold a comparison in GIMPLE: $ cat ice.i.143t.optimized ;; Function func1 (func1) func1 () { <bb 2>: return; } ;; Function foo (foo) foo () { int D.1291; long long unsigned int D.1290; <bb 2>: array1[0] = 0; D.1290_6 = 0; D.1291_7 = D.1290_6 == 1; bar (D.1291_7); [tail call] return; } TER propagates D.1290_6 into the comparison: Replacing Expressions D.1290_6 replace with --> D.1290_6 = 0; D.1291_7 replace with --> D.1291_7 = D.1290_6 == 1; The ICE goes away with "-fno-tree-ter". This is not a target bug IMHO, but a tree-optimization bug.