https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120086
--- Comment #22 from John David Anglin <danglin at gcc dot gnu.org> --- I was about to install a similar patch for hppa-hpux. I think the builtin falls back to emitting sync libcalls when enabled or calls to libatomic. Not sure whether the atomic support detection could be improved or not.