x86 omit leaf frame pointer (was Re: egcs-1.2 stuff)
John Wehle
john@feith.com
Fri Mar 19 17:29:00 GMT 1999
>> Tue Nov 3 23:01:34 EST 1998 John Wehle (john@feith.com)
>>
>> * i386.h (MASK_OMIT_LEAF_FRAME_POINTER): Use octal for consistency.
>> (TARGET_SWITCHES): Omit leaf frame pointer by default.
>> (FRAME_POINTER_REQUIRED): Use current_function_sp_is_unchanging
>> instead of leaf_function_p.
>> * i386.c (override_options): Have flag_omit_frame_pointer
>> override TARGET_OMIT_LEAF_FRAME_POINTER.
>
>IMHO this is bogus.
> We already have the tm.h macro CAN_DEBUG_WITHOUT_FP.
Which isn't true for the x86. In general functions without a frame pointer
can't be debugged. I contributed support for debugging functions where
the stack pointer is unchanging (i.e. leaf functions).
> Is there any reason not to use it?
Yes. See above.
> Even if for some reason it can't be made to work, the place for optimization
> options is OPTIMIZATION_OPTIONS. OVERRIDE_OPTIONS has a different purpose.
OVERRIDE_OPTIONS is documented as handling interactions between options. It
is used to ensure that a sane set of options are in effect. Currently (on
the x86) it ensures that flag_omit_frame_pointer is set if
TARGET_OMIT_LEAF_FRAME_POINTER is set (the combination of
flag_omit_frame_pointer == 0 && TARGET_OMIT_LEAF_FRAME_POINTER == 1 is
invalid). My change merely notes that TARGET_OMIT_LEAF_FRAME_POINTER shouldn't
be set if -fomit-frame-pointer was given on the command line. This use of
OVERRIDE_OPTIONS seems consistent with the documentation.
On a different note ... it probably makes more sense to set
TARGET_OMIT_LEAF_FRAME_POINTER in OPTIMIZATION_OPTIONS instead of changing
TARGET_SWITCHES in i386.h
-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------
More information about the Gcc
mailing list