[Bug target/79439] Missing nop instruction after recursive call corrupts TOC register
fw at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 9 12:21:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79439
--- Comment #2 from Florian Weimer <fw at gcc dot gnu.org> ---
(In reply to Segher Boessenkool from comment #1)
> What command line options does this need?
Sorry, I used -O2 -fpic.
Indeed, GCC seems to perform target-independent optimizations based on an
assumption that the recursive call calls the same function as defined in the
translation unit. If this is the desired behavior, the proper fix would be to
use a local reference for the recursive call. This would make those
optimizations consistent, and interposition would work to some extent. Of
course, the recursive calls wouldn't be interposed anymore, but the TOC
corruption would at least be gone.
More information about the Gcc-bugs
mailing list