This is the mail archive of the
mailing list for the GCC project.
Re: Frame pointer optimization issues
- From: Richard Henderson <rth at redhat dot com>
- To: Wilco Dijkstra <wdijkstr at arm dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 20 Aug 2014 16:24:42 -0700
- Subject: Re: Frame pointer optimization issues
- Authentication-results: sourceware.org; auth=none
- References: <000801cfbc8a$8ce28d40$a6a7a7c0$ at com>
On 08/20/2014 08:22 AM, Wilco Dijkstra wrote:
> 2. Change the mid-end to call <arch>_frame_pointer_required even when
Um, it does that already. At least as far as I can see from
ira_setup_eliminable_regset and update_eliminables.
It turns out to be much easier to re-enable a frame pointer for a given
function than to disable a frame pointer. Thus I believe that you should
approach -momit_leaf_frame_pointer as setting flag_omit_frame_pointer, and then
re-enabling it in frame_pointer_required. This requires more than one line in
common/config/arch/arch.c, but it shouldn't be much more than ten.
> A second issue with frame pointers is that update_eliminables() in reload1.c might set
> frame_pointer_needed to false without any checks.
How? I don't see that path, since the very first thing update_eliminables does
is call frame_pointer_required -- even before it calls can_eliminate.
Incidentally, I was working on exactly this (plus improving the unwind info)
before I left on vacation a couple weeks ago. Note that you'll also need to
remove x29 from the fixed registers before eliminating the frame pointer does
any real good.