This is the mail archive of the gcc@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: RFH: gen_rtx_MEM / gen_rtx_CONST in ada front-end code


> Could you please help me with some code in
> ada/gcc-interface/decl.c::gnat_to_gnu_entity:
>
>         /* For a debug renaming declaration, build a pure debug entity.  */
>         if (Present (Debug_Renaming_Link (gnat_entity)))
>           {
>             rtx addr;
>             gnu_decl = build_decl (input_location,
>                                    VAR_DECL, gnu_entity_name, gnu_type);
>             /* The (MEM (CONST (0))) pattern is prescribed by STABS.  */
>             if (global_bindings_p ())
>               addr = gen_rtx_CONST (VOIDmode, const0_rtx);
>             else
>               addr = stack_pointer_rtx;
>             SET_DECL_RTL (gnu_decl, gen_rtx_MEM (Pmode, addr));
>             gnat_pushdecl (gnu_decl, gnat_entity);
>             break;
>           }

It's a gigi hack to support a front-end kludge. :-)

> I would like to remove this code from ada, but I am not sure what the
> purpose of this code is. What should I do with this code?

The goal is to build a pure debugging variable, i.e. a variable that will be 
present only in the debug info.  GDB is supposed to magically recognize its 
name and deduce something from its presence in the scope.

This was done this way to prevent debug stuff from altering code generation 
and avoid wasting space.  Yes, the whole design is questionable, give me a 
few days to investigate whether it can be modified.

-- 
Eric Botcazou


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