middle-end/69482 - not preserving volatile accesses
The following addresses a long standing issue with not preserving
accesses to non-volatile objects through volatile qualified
pointers in the case that object gets expanded to a register. The
fix is to treat accesses to an object with a volatile qualified
access as forcing that object to memory. This issue got more
exposed recently so it regressed more since GCC 11.
PR middle-end/69482
* cfgexpand.cc (discover_nonconstant_array_refs_r): Volatile
qualified accesses also force objects to memory.
* gcc.target/i386/pr69482-1.c: New testcase.
* gcc.target/i386/pr69482-2.c: Likewise.