* [Ada] Fix internal error on subprogram instantiation
@ 2022-05-18 8:43 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-18 8:43 UTC (permalink / raw)
To: gcc-patches; +Cc: Eric Botcazou
[-- Attachment #1: Type: text/plain, Size: 381 bytes --]
The compiler builds renamings for actuals of formal objects for debugging
purposes in this case, but it must not generate them for temporaries.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_dbug.ads (Build_Subprogram_Instance_Renamings): Fix typo.
* exp_dbug.adb (Build_Subprogram_Instance_Renamings): Build the
renaming only for actuals of formal objects.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 1139 bytes --]
diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb
--- a/gcc/ada/exp_dbug.adb
+++ b/gcc/ada/exp_dbug.adb
@@ -1028,6 +1028,7 @@ package body Exp_Dbug is
E := First_Entity (Wrapper);
while Present (E) loop
if Nkind (Parent (E)) = N_Object_Declaration
+ and then Present (Corresponding_Generic_Association (Parent (E)))
and then Is_Elementary_Type (Etype (E))
then
Loc := Sloc (Expression (Parent (E)));
diff --git a/gcc/ada/exp_dbug.ads b/gcc/ada/exp_dbug.ads
--- a/gcc/ada/exp_dbug.ads
+++ b/gcc/ada/exp_dbug.ads
@@ -1444,7 +1444,7 @@ package Exp_Dbug is
-- placed within the wrapper package of the instance, and the entity in
-- these declarations is encoded in a complex way that GDB does not handle
-- well. These new renaming declarations appear within the body of the
- -- subprogram, and are redundant from a visibility point of view, but They
+ -- subprogram, and are redundant from a visibility point of view, but they
-- should have no measurable performance impact, and require no special
-- decoding in the debugger.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-18 8:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18 8:43 [Ada] Fix internal error on subprogram instantiation Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).