SuperH target not emitting instructions to use frame pointer?

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


Hello everyone,

Version: GCC 4.3.6
Target: sh
OS: GNU/Linux
Flags passed to GCC configure:
--enable-frame-pointer
--disable-cld
--disable-initfini-array
--disable-largefile
--disable-libstdcxx-pch
--disable-multilib
--disable-multilib
--disable-nls
--disable-objc-gc
--disable-rpath
--disable-shared
--disable-threads
--disable-tls
--disable-win32-registry
--enable-decimal-float=no
--enable-languages=c,c++
--enable-static
--program-prefix="sh-elf-"
--target="sh-elf"
--with-gcc
--with-gnu-as
--with-gnu-ld
--with-newlib

On this architecture, the r14 register is considered to be the frame
pointer register. The "pr" register is the procedure register that
holds the return address. The "JSR" appropriately sets the "pr"
register while "JMP" or any of the branch instructions do not.

The flags I've used to compile my binaries (no ELF executables):
-O2 -fno-omit-frame-pointer

Seeing above that I passed '--enable-frame-pointer', GCC still does
not use the frame pointer. I even when in and enabled the C
preprocessor macro, SUBTARGET_FRAME_POINTER_REQUIRED which forces
FRAME_POINTER_REQUIRED to return TRUE. I didn't use the
machine-description macro FRAME_POINTER_REQUIRED. Could that also be
it? Where would I set this?

The ONLY way it works is if EVERY function has the following
attribute: '__attribute__((optimize("-fno-omit-frame-pointer")))', but
I MUST use the -O2 optimization level or else the frame pointer will
not be used again.


Am I missing something important here? I would simply like to have
-fomit-frame-pointer and -fno-frame-pointer work as expected.


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

Add to Google