https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111003
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- Of course that's not really a "fix", but it's restoring of not doing the extra hoisting. So it does fix the regression but not maybe the underlying issue. We're not anticipating more imprecise range-info on DEFs when hoisting here. The "real" fix would be to improve conditional hoisting - we have <bb 12> [local count: 29170419070]: # prephitmp_61 = PHI <pretmp_60(11), prephitmp_59(10)> _13 = (unsigned int) _3; if (_3 > 6) goto <bb 73>; [50.00%] else goto <bb 13>; [50.00%] <bb 73> [local count: 14585209535]: goto <bb 14>; [100.00%] <bb 13> [local count: 14585209535]: iftmp.9_18 = _13 << 6; _63 = _13 ^ iftmp.9_18; _65 = _63 != 10; <bb 14> [local count: 35145083376]: # prephitmp_66 = PHI <1(73), _65(13), 1(74)> # prephitmp_67 = PHI <prephitmp_61(73), prephitmp_61(13), prephitmp_59(74)> and the diamond with if (_3 > 6) including the precceding def of _13 (which wasn't sunk) is invariant. There's an existing bug about LIM missing a way to hoist a sub-CFG (it can only hoist PHIs as COND_EXPRs). It might not exactly fit "LIM" but could be integrated with this pass. I'd say we close this bug, I'll add the testcase.