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: Roger Sayle <roger at eyesopen dot com>
- To: Josef Zlomek <zlomekj at suse dot cz>
- Cc: Richard Sandiford <rsandifo at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 4 Jul 2004 08:29:59 -0600 (MDT)
- Subject: Re: Fix var-tracking WRT location list for DW_AT_frame_base
On Sun, 4 Jul 2004, Josef Zlomek wrote:
> 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)
> {
> 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)));
> }
Sure. I appreciate that if performance is a concern that both
plus_constant and simplify_gen_binary are probably overkill.
The issue is that if you don't use either of these functions,
you manually have to check for the "zero" case.
Your function above looks fine, provided you remember to add a
suitable comment above it.
Thanks,
Roger
--