This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
function call return path optimization
- From: "Chen, Kenneth W" <kenneth dot w dot chen at intel dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Mon, 11 Aug 2003 21:32:35 -0700
- Subject: function call return path optimization
If function a() calls b() and b() calls c(), gcc recognize that if c() is the last function in b() and optimized a code path that returns to a() directly from c().
This optimization confuses a run time profiler that looks at the current call frame to determine the caller. So in the above case, inside function c(), it looks like it was called from a(). But from source level, c() is called from b().
Is there a way to turn just that optimization off? I still need the -O2 option to keep other optimization.
The gcc version I'M using is 3.3 and is on ia64 platform.