This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix var-tracking WRT location list for DW_AT_frame_base
- From: Josef Zlomek <zlomekj at suse dot cz>
- To: Richard Sandiford <rsandifo at redhat dot com>
- Cc: Roger Sayle <roger at eyesopen dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 4 Jul 2004 10:25:25 +0200
- Subject: Re: Fix var-tracking WRT location list for DW_AT_frame_base
- References: <20040622113600.GA21273@artax.karlin.mff.cuni.cz> <Pine.LNX.4.44.0407031546370.15303-100000@www.eyesopen.com> <87eknsgpl6.fsf@redhat.com>
> > And how about changing
> >
> >> /* Set its initial "location". */
> >> ! base = gen_rtx_MEM (Pmode,
> >> ! gen_rtx_PLUS (Pmode, stack_pointer_rtx,
> >> ! GEN_INT (frame_stack_adjust)));
> >
> > to
> >
> > base = frame_stack_adjust
> > ? gen_rtx_PLUS (Pmode, stack_pointer_rtx,
> > GEN_INT (frame_stack_adjust))
> > : stack_pointer_rtx;
> > base = gen_rtx_MEM (Pmode, base);
>
> Maybe it'd be better to use plus_constant. I.e.:
>
> base = gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx,
> frame_stack_adjust);
IMHO plus_constant is too heavyweight, all I need is to generate a
(mem (stackreg)) or (mem (plus (stackreg) (const)))
What about using the following function instead of those gen_rtx_MEMs
which would probably get inlined?
static rtx
frame_base_location_rtx (HOST_WIDE_INT offset)
{
rtx x;
if (offset == 0)
return gen_rtx_MEM (Pmode, stack_pointer_rtx);
return gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, stack_pointer_rtx,
GEN_INT (offset)));
}
Regards,
Josef