http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55281
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-12 16:23:29 UTC --- I'm just testing that, so I know it doesn't have side-effects. COND_EXPR handling which I've copied was doing the same thing. The reason for the fold-const.c change was that while you handle that case in forwprop, it only triggers if forwprop actually simplifies the condition, but if e.g. copyprop does that, then nothing will fix it up afterwards till expansion.