https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108748
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW CC| |amacleod at redhat dot com Last reconfirmed| |2023-02-10 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- The GIMPLE we see sems to be uint64_t foo (uint64_t x) { <bb 2> : if (POLY_INT_CST [16, 16] == 2) goto <bb 3>; [INV] else goto <bb 4>; [INV] <bb 3> : x_6 = x_5(D) + POLY_INT_CST [1600, 1600]; <bb 4> : # x_4 = PHI <x_5(D)(2), x_6(3)> return x_4; so any such optimization would derive the TU wide constant(?) N that is applied to all POLY_INT_CSTs? Is there a set_svcntb (..) intrinsic that would clobber such knowledge? That said, we'd track a "virtual" variables range here. For the above I wonder why we cannot constant fold it - [16, 16] can never be 2, no?