https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33053
--- Comment #5 from Daniel Lundin <daniel.lundin.mail at gmail dot com> --- The intention of DR 476 (Sebor) https://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm#dr_476 was a clarification leading to a volatile lvalue access being a side effect, as opposed to an access of volatile objects. Changes from the DR were included in C23. The C23 n3054 draft now says "An access to an object through the use of an lvalue of volatile-qualified type is a volatile access. A volatile access to an object, modifying an object, modifying a file, or calling a function that does any of those operations are all side effects-..." This ought to result in stricter optimizing behavior from gcc, not the other way around. As reported in bugĀ 108298 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108298), gcc 11 and beyond rather seems to optimize more aggressively, which it didn't up to version 10.4.