This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about ARM -mapcs-frame documentation
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: gcc at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Mon, 13 Oct 2003 13:19:27 +0100
- Subject: Re: Question about ARM -mapcs-frame documentation
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> The documentation for the ARM -mapcs-frame option says this:
>
> @item -mapcs-frame
> @opindex mapcs-frame
> Generate a stack frame that is compliant with the ARM Procedure Call
> Standard for all functions, even if this is not strictly necessary for
> correct execution of the code. Specifying @option{-fomit-frame-pointer}
> with this option will cause the stack frames not to be generated for
> leaf functions. The default is @option{-mno-apcs-frame}.
>
> This says that the default is -mno-apcs-frame. However, the default
> definition of TARGET_DEFAULT, and many of the overrides, include
> ARM_FLAG_APCS_FRAME. The exceptions I see are:
> arm*-*-linux*
> arm*-*-uclinux*
> arm*-wince-pe*
> arm-*-pe*
> strongarm-*-pe
> arm-semi-aof
> armel-semi-aof
>
> So for other targets, I think -mapcs-frame is currently the default.
> These other targets are:
> arm-*-coff*
> armel-*-coff*
> arm*-*-freebsd*
> strongarm*-*-freebsd*
> arm*-*-netbsdelf*
> arm*-*-netbsd*
> arm*-*-ecos-elf
> arm*-*-rtems*
> arm*-*-elf
> ep9312-*-elf
> arm*-*-kaos*
>
> Is this an error in the documentation or an error in the code?
You are in a twisty little maze of options, all different.
The documentation is wrong, the default is target-specific. If there are
any targets in error, then it is probably those that default to
-mno-apcs-frame, since on these it is hard to debug with gdb unless you
have full dwarf unwind tables (support on ARM is only just coming); and
the gcc guide says that the frame pointer should only be omitted if it
does not affect debugging.
However, using a frame pointer is very costly, which is why some targets
prefer to default to not using one.
The trend will increasingly be towards configurations that do not use a
frame pointer; indeed that ATPCS and AAPCS (in preparation) make no use of
a frame pointer and instead say that dwarf unwind information must always
be emitted, even for non-debuggable code.
R.