https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96402
Bug ID: 96402 Summary: [10/11 Regression] Wrong code with -moutline-atomics Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: rth at gcc dot gnu.org Target Milestone: --- Host: aarch64-linux-gnu The following is miscompiled: $ cat x.c #include <stdio.h> int main(void) { __int128 a = 0; __sync_val_compare_and_swap(&a, 0, 1); printf("a:%d\n", (int)a); if (a == 0) __builtin_abort (); return 0; } $ gcc x.c -moutline-atomics && ./a.out a:0 Aborted (core dumped) $ gcc x.c -mno-outline-atomics && ./a.out a:1