This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Set default to -fomit-frame-pointer


On 11/08/2017 10:47 AM, Wilco Dijkstra wrote:
> Joseph Myers wrote:
>> On Fri, 3 Nov 2017, Wilco Dijkstra wrote:
>>
>>> Almost all targets add an explict -fomit-frame-pointer in the target specific
>>> options.  Rather than doing this in a target-specific way, do this in the
>>
>> Which targets do not?  You should explicitly list them and CC their 
>> maintainers and seek confirmation that such a change is appropriate for 
>> them.
> 
> The targets that don't explicitly enable -fomit-frame-pointer in the target
> options or force it internally are bfin, ft32, h8300, m68k - I've CCd the
> maintainers (it seems there is no-one for h8300).
Which means it's probably myself or Alex for the H8 :(  Some things you
can never manage to get rid of.

I'd actually prefer to deprecate the H8 and M68k.  But assuming that's
not going to happen in the immediate future I think dropping frame
pointers on those targets is appropriate as long as we're generating
dwarf frame info.

For deeply embedded targets that don't want the overhead of dwarf, well,
IMHO, they can add -fno-omit-frame-pointer explicitly :-)


> 
>> The addition of -fomit-frame-pointer through this mechanism was a 
>> replacement for the old target macro CAN_DEBUG_WITHOUT_FP.  It may now be 
>> the cases that with DWARF debug info, having or not having a frame pointer 
>> is not particularly relevant to debugging.  But since there are other 
>> reasons people may want a frame pointer (e.g. light-weight backtraces that 
>> don't depend on debug / unwind info), it's at least possible there are 
>> architecture-specific choices regarding keeping frame pointers involved 
>> here.
> 
> I believe in those cases targets already force the frame pointer as required,
> for example msp430 sets the frame pointer if unwind tables are emitted
> irrespectively of the command-line or default setting. Various other targets
> don't even use frame_pointer_needed and just do their own thing.
I've had the "pleasure" of going round and round on this repeatedly
through the years with the kernel teams on this.  Essentially they
didn't want to embed the dwarf2 unwinder in the kernel or have all those
pages of unwind data.  Instead they strongly preferred to have a frame
pointer to facilitate easy and fast unwinding.

So  my concern is to make sure the kernel folks, particularly in the
ia32 world aren't going to get hosed by this change.  If we're changing
the default it needs to be signaled to them so that they can ensure that
if they want frame pointers that they still get them.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]