GCC option to control function call epilogue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Currently GCC may generate two kinds of function call epilogue when -fno-omit-frame-pointer is used. When no optimization is turned on, GCC generate epilogue like this:

	mov bp, sp (or lea 0x10(bp), sp, 0x10 is space for callee saved registers)
	pop bp
	ret

When optimization is turned on, like -O2, and stack frame size is known at compile time, GCC generates epilogue like this:

	add 0x80, sp (0x80 is the size of space for local variables)
	pop bp
	ret

For some reason (details omitted for brevity), I need GCC to always generate the first kind of epilogue for some  functions, where the sp is updated through bp, rather than through an offset to itself. (basically, I need to modify sp, so add 0x80, sp is no longer valid, but mov bp, sp still is).

I’d like to know whether GCC has an option to control this behavior, even with optimization such as -O2 is used.

Thanks,
Chaoran




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux