From c03550f61c494dd20c46578aa4bc9a525323782c Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 10 Sep 2007 08:52:53 +0000 Subject: [PATCH] decl.c (gnat_to_gnu_entity): Deal with variable built for a debug renaming declaration specially. * decl.c (gnat_to_gnu_entity) : Deal with variable built for a debug renaming declaration specially. From-SVN: r128327 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/decl.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3c5969d96ea..b4824a9d5ce 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2007-09-10 Eric Botcazou + + * decl.c (gnat_to_gnu_entity) : Deal with variable built for + a debug renaming declaration specially. + 2007-09-08 Eric Botcazou * decl.c (gnat_to_gnu_entity) : Simplify the condition under diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 202cca851ad..5aa4bc8dd37 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -523,6 +523,21 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* Get the type after elaborating the renamed object. */ gnu_type = gnat_to_gnu_type (Etype (gnat_entity)); + /* For a debug renaming declaration, build a pure debug entity. */ + if (Present (Debug_Renaming_Link (gnat_entity))) + { + rtx addr; + gnu_decl = build_decl (VAR_DECL, gnu_entity_id, 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; + } + /* If this is a loop variable, its type should be the base type. This is because the code for processing a loop determines whether a normal loop end test can be done by comparing the bounds of the -- 2.30.2