This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Disable specific function call optimization
- From: Mason <slash dot tmp at free dot fr>
- To: GCC help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 19 Apr 2017 16:28:37 +0200
- Subject: Disable specific function call optimization
- Authentication-results: sourceware.org; auth=none
Hello,
(I'm working on 32-bit arm in case it matters.)
There's an obvious optimization, when a function ends with
a function call, to issue a jump instead of a call.
Thus, upon return from the leaf function, we avoid a return
instruction. My problem is that this optimization breaks
tools that print function back traces :-)
I would guess the optimization is enabled by -foptimize-sibling-calls
So -fno-optimize-sibling-calls would disable it?
Regards.