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: 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
--


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