https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115802
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I am not 100% sure this is a bug since cond_wait is known not to touch val even though it has an atomic in it. If you mark it as noipa, then the GCC trunk gets it "correct".