http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48822
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Component|c++ |tree-optimization AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | Summary|[4.5 Regression] G++ gets |[4.5/4.6/4.7 Regression] |stucks and never finishes |G++ gets stucks and never |compilation when enabling |finishes compilation when |-O2/3 optimization options. |enabling -O2/3 optimization | |options. --- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-29 14:06:24 UTC --- D.23284.num = 0; D.23284.den = 0; ... <bb 11>: D.23599_34 = D.23284.den; if (D.23599_34 == 0) goto <bb 21> (<L10>); else goto <bb 12>; <bb 12>: g_35 = D.23284.den; g_36 = D.23284.num; goto <bb 14>; <bb 13>: g_39 = g_37 % g_38; <bb 14>: # g_37 = PHI <g_36(12), g_38(13)> # g_38 = PHI <g_35(12), g_39(13)> if (g_38 != 0) goto <bb 13>; and D.23599_34, g_35 and g_36 are correctly value-numbered to zero. We then start Value numbering g_37 stmt = g_37 = PHI <g_36(12), g_38(13)> Setting value number of g_37 to 0 (changed) Value numbering g_38 stmt = g_38 = PHI <g_35(12), g_39(13)> Setting value number of g_38 to 0 (changed) Value numbering g_39 stmt = g_39 = g_37 % g_38; Setting value number of g_39 to g_39 (changed) g_39 has undefined result, thus Value numbering g_37 stmt = g_37 = PHI <g_36(12), g_38(13)> Setting value number of g_37 to 0 Value numbering g_38 stmt = g_38 = PHI <g_35(12), g_39(13)> Setting value number of g_38 to g_38 (changed) Value numbering g_39 stmt = g_39 = g_37 % g_38; RHS g_37 % g_38 simplified to 0 has constants 1 where here is the bug that we go from VARYING to CONSTANT for g_39. ISTR changing VN to never do that but that had lots of weird fallout. I'm sure the issue is latent.