http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45685
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org, | |spop at gcc dot gnu.org --- Comment #14 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-25 11:13:06 UTC --- First of all tree if-conversion goes crazy here. What Jakub refers to (optimizing the constants) should be done while we still have the PHIs around: <bb 5>: # val_4 = PHI <1(4), -1(3)> # prephitmp.26_45 = PHI <-1(4), 1(3)> # prephitmp.27_46 = PHI <4294967295(4), 1(3)> # prephitmp.27_48 = PHI <1(4), 4294967295(3)> here at least prephitmp.26_45 = -val_4, prephitmp.27_46 = -prephitmp.27_48, etc. Now - we can teach PRE not to do PHI insertions for sign changes or negations, but it's hard to tell if the insertion involved further simplifications that are worthwhile. We go from <bb 5>: # val_4 = PHI <1(4), -1(11)> ... if (D.4323_24 != i_19) goto <bb 6>; else goto <bb 12>; <bb 12>: goto <bb 7>; <bb 6>: val_25 = -val_4; <bb 7>: # val_3 = PHI <val_4(12), val_25(6)> ... D.4326_28 = (unsigned int) val_3; to the above, inserting for -val_4 and (unsigned int) val_3. That said, if-conversion should be improved for the case of generating constants.