https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72795
--- Comment #2 from Ahmad Fatoum <ahmad at a3f dot at> --- The write that can't be optimized away is the final assignment to x. The `movl $1, x(%rip)` prior to the barrier should've been optimized out, IMO.