https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118222
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-12-27 Status|UNCONFIRMED |WAITING --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- GCC has an IPA RA. So if is_ENOTSUP is local to that file, GCC will see if edx is not clobbered by that function, GCC can assume it can be used across the call. I am suspecting you are seeing that effect. You can turn that off with -fno-ipa-ra . See https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Optimize-Options.html#index-fipa-ra also. Also can you attach the preprocessed source for copy.o and the exact command line that is used to compile it? as directed on https://gcc.gnu.org/bugs/ .