This is the mail archive of the 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: DWARF: Represent hard frame pointer as stack pointer + offset

On Fri, Aug 31, 2018 at 3:33 PM, H.J. Lu <> wrote:
> On Thu, Aug 30, 2018 at 10:21 AM, Jason Merrill <> wrote:
>>> r138335 allowed arg_pointer_rtx to be eliminated by either FP or SP,
>>> but only when dynamic stack alignment is supported.  In this case,
>>> arg_pointer_rtx is eliminated by FP even when frame_pointer_needed
>>> is false and there is no dynamic stack alignment at all.
>>>> gcc_assert (elim == stack_pointer_rtx || (frame_pointer_needed && elim
>>>> == hard_frame_pointer_rtx));
>>>> so as not to allow eliminating to an uninitialized FP.
>>> FP isn't uninitialized.  It is initialized the same way as in the case of
>> How is that?  Why would it be initialized when frame_pointer_needed is
>> false?  What does it mean for frame_pointer_needed to be false, if
>> not, as in the documentation of -fomit-frame-pointer,
>> "This avoids the instructions to save, set up and restore the frame
>> pointer; on many targets it also makes an extra register available."
>> ?
> A backend may not set up frame pointer even with -fno-omit-frame-pointer.
> In the case of x86,  hard frame pointer can be represented by stack pointer
> This patch adds hard_frame_pointer_from_stack_pointer_plus_offset and
> hard_frame_pointer_offset to rtl_data to allow a backend to represent
> hard frame pointer as stack pointer + offset.

Shouldn't this be fixed in eliminate_regs rather than dwarf2out?


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