https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> --- I don't know what the assembly code does sorry, but it's not permitted to store to the 'expected' value unless the atomic variable is not equal to it. It looks like this would update the 'expected' value unconditionally? I agree with Jakub that we don't want the additional instructions because they will be redundant in some cases where the user has already done a load.