[Bug ipa/124218] ipa ignores memory clobbers for non-static variables.

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 23 18:40:11 GMT 2026


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=80728
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think without the volatile qualifier on flag, GCC and see that it is not
modified by anything so it becomes static (local) and since the address of the
flag variable is NOT taken GCC can assume it is not modified elsewhere.

You can use the used attribute on flag variable to fix the code.

This is exactly the same as I mentioned in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80728#c9 .

So yes this is a dup and most likely invalid way of doing this code.

*** This bug has been marked as a duplicate of bug 80728 ***


More information about the Gcc-bugs mailing list