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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jsm28 at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The #c0 question is questionable, just the fact that you cast something to a
volatile qualified pointer IMHO doesn't mean the actual atomic load is through
volatile qualified effective type.
And e.g. in GIMPLE hardly fixable, pointer to pointer type conversions are
useless in GIMPLE, so whether one gets a pointer to volatile qualified type or
not is a complete lottery.  Consider:
void
foo (volatile unsigned *p)
{
  __atomic_load_4 ((unsigned *) p, __ATOMIC_RELAXED);
}

void
bar (unsigned *p)
{
  __atomic_load_4 ((volatile unsigned *) p, __ATOMIC_RELAXED);
}
We see volatile unsigned * pointer in the first case even when it has been cast
away, and non-volatile one in the second case.
The #c1 case can be handled I think, if the argument is ADDR_EXPR to some
volatile object or subobject of a volatile object, we can just punt on the
r17-75 optimization.

Reply via email to