public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* SuperH target not emitting instructions to use frame pointer?
@ 2012-06-09 16:04 Israel Jacquez
  2012-06-09 16:33 ` Israel Jacquez
  0 siblings, 1 reply; 2+ messages in thread
From: Israel Jacquez @ 2012-06-09 16:04 UTC (permalink / raw)
  To: gcc-help

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SuperH target not emitting instructions to use frame pointer?
  2012-06-09 16:04 SuperH target not emitting instructions to use frame pointer? Israel Jacquez
@ 2012-06-09 16:33 ` Israel Jacquez
  0 siblings, 0 replies; 2+ messages in thread
From: Israel Jacquez @ 2012-06-09 16:33 UTC (permalink / raw)
  To: gcc-help

Looks like I have made some typos. My apologies.

Seeing above that I passed '--enable-frame-pointer', GCC still does
not use the frame pointer. I even went in and enabled the C
preprocessor macro, SUBTARGET_FRAME_POINTER_REQUIRED which forces
TARGET_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?

Also, I'm recompiling GCC by passing the flag '--without-dwarf2'. In
gcc/config/sh.c, there is a boolean checking if the debugging type
DWARF-2 is preferred: flag_omit_frame_pointer =
(PREFERRED_DEBUGGING_TYPE == DWARF2_DEBUG)

I'll report back.

On Sat, Jun 9, 2012 at 9:04 AM, Israel Jacquez <mrkotfw@gmail.com> wrote:
> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-09 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-09 16:04 SuperH target not emitting instructions to use frame pointer? Israel Jacquez
2012-06-09 16:33 ` Israel Jacquez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).