[Bug middle-end/124707] Provide `#pragma GCC loop nolim` which disables gimple level lim (NOT PRE) for a specific loop

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 31 08:55:25 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124707

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think disabling the store-motion part can make sense (in particular if that
would use conditionals due to store data races) as that tends to increase
register pressure.

But I'd rather not define loop pragmas in terms of passes but in terms
of actual transforms.  Disabling all invariant motion doesn't make much
sense to me though, instead maybe sth like

 for (...)
  {
    if (...)
#pragma GCC do-not-move
      global += 1;
  }

though we of course lack good ways to stick that information to a block
of code.

It would be interesting to know what motivated the clang folks to add that
pragma.  The pull request just says "we have code ..."


More information about the Gcc-bugs mailing list