]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix internal error on subprogram instantiation
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 1 Apr 2022 23:21:36 +0000 (01:21 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 18 May 2022 08:41:01 +0000 (08:41 +0000)
The compiler builds renamings for actuals of formal objects for debugging
purposes in this case, but it must not generate them for temporaries.

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.

gcc/ada/exp_dbug.adb
gcc/ada/exp_dbug.ads

index 2231b9c77742456b424b4c72aeb7c5429a814258..76f08e3619bfc38077f8511a1c8af990806f47e8 100644 (file)
@@ -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)));
index 0c0dd1a0b0ff67b407e4ae5a43c4a8665732fe0e..273d6eded93c40659a6788dd0e8c8682a6773121 100644 (file)
@@ -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.