This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RFH: gen_rtx_MEM / gen_rtx_CONST in ada front-end code
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Wed, 26 May 2010 13:05:47 +0200
- Subject: RFH: gen_rtx_MEM / gen_rtx_CONST in ada front-end code
Hello Eric,
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;
}
Setting DECL_RTL here is a problem. Front ends should not have to set
DECL_RTL, and it breaks with LTO (which does not stream DECL_RTL). Ada
is the last front end to set DECL_RTL to something non-NULL:
$ grep SET_DECL_RTL c-*.[ch] cp/*.[ch] objc/*.[ch] objcp/*.[ch]
fortran/*.[ch] java/*.[ch] ada/gcc-interface/*.[ch]
cp/class.c: SET_DECL_RTL (clone, NULL);
cp/method.c: SET_DECL_RTL (x, NULL);
cp/pt.c: SET_DECL_RTL (new_friend, NULL);
cp/pt.c: SET_DECL_RTL (r, NULL);
cp/pt.c: SET_DECL_RTL (r, NULL);
cp/pt.c: SET_DECL_RTL (r, NULL);
cp/pt.c: SET_DECL_RTL (d, NULL);
java/decl.c: SET_DECL_RTL (decl, 0);
ada/gcc-interface/decl.c: SET_DECL_RTL (gnu_decl,
gen_rtx_MEM (Pmode, addr));
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?
Thanks for any help/advice you can give,
Ciao!
Steven