https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104200
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org Last reconfirmed| |2022-01-27 Status|UNCONFIRMED |ASSIGNED --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I am going to fix this testcase. The warning is expected, the code does check at runtime not to invoke __atomic_compare_exchange_n with invalid orderings. /* The success memory ordering must be at least as strong as \ the failure memory ordering. */ \ if (model_s < model_f) \ return 0; \ /* Ignore invalid memory orderings. */ \ if (model_f == __ATOMIC_RELEASE || model_f == __ATOMIC_ACQ_REL) \ return 0; \ I am trying to decide I just want to add -Wno-invalid-memory-model or add the dg-warning . I am leaning towards adding the flag.