[Bug target/122925] sh: function is miscompiled
kristerw at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 1 14:39:10 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122925
--- Comment #4 from Krister Walfridsson <kristerw at gcc dot gnu.org> ---
I'm running on GCC trunk configured for sh-elf, and testing with sh-elf-run
from GDB 16.3.
-O0 generates correct code. All other optimization levels reproduce the bug for
me.
I get the same issue with smtgcc, so I think it is a real issue. But Newlib's
abort() on sh-elf-run is annoying as it just performs exit(1), so I have also
verified that I get the incorrect result when prinf:ing the result of foo.
More information about the Gcc-bugs
mailing list