]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR ada/91995 (gnat miscompilation and bootstrap failure on m68k-linux)
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 12 Oct 2019 14:51:26 +0000 (14:51 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 12 Oct 2019 14:51:26 +0000 (14:51 +0000)
PR ada/91995
* sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
* sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
and adjust accordingly.

From-SVN: r276919

gcc/ada/ChangeLog
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads

index 176a5c4bc40ca50f3817487f3c88ec33b4eaf139..14a5dbca52a1428f500e38919f9681c339847c1d 100644 (file)
@@ -1,3 +1,10 @@
+2019-10-12  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR ada/91995
+       * sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
+       * sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
+       and adjust accordingly.
+
 2019-10-11  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the
index 1a7b6ab92af2efc03d13e709ef6ef95eb957f2d4..d461692807ef887a5efd5d9a4305d915902e706d 100644 (file)
@@ -5203,10 +5203,7 @@ package body Sem_Util is
    -- Defining_Entity --
    ---------------------
 
-   function Defining_Entity
-     (N               : Node_Id;
-      Empty_On_Errors : Boolean := False) return Entity_Id
-   is
+   function Defining_Entity (N : Node_Id) return Entity_Id is
       Err : Entity_Id := Empty;
 
    begin
@@ -5285,14 +5282,10 @@ package body Sem_Util is
                --  can continue semantic analysis.
 
                elsif Nam = Error then
-                  if Empty_On_Errors then
-                     return Empty;
-                  else
-                     Err := Make_Temporary (Sloc (N), 'T');
-                     Set_Defining_Unit_Name (N, Err);
+                  Err := Make_Temporary (Sloc (N), 'T');
+                  Set_Defining_Unit_Name (N, Err);
 
-                     return Err;
-                  end if;
+                  return Err;
 
                --  If not an entity, get defining identifier
 
@@ -5307,11 +5300,7 @@ package body Sem_Util is
             return Entity (Identifier (N));
 
          when others =>
-            if Empty_On_Errors then
-               return Empty;
-            else
-               raise Program_Error;
-            end if;
+            raise Program_Error;
       end case;
    end Defining_Entity;
 
index cfec762dcb3d806ecdc6341e129c3ba8aaaed94b..5a33d4670837fd7a59ee651b1926020bd7e654f0 100644 (file)
@@ -474,9 +474,7 @@ package Sem_Util is
    --  in the case of a descendant of a generic formal type (returns Int'Last
    --  instead of 0).
 
-   function Defining_Entity
-     (N               : Node_Id;
-      Empty_On_Errors : Boolean := False) return Entity_Id;
+   function Defining_Entity (N : Node_Id) return Entity_Id;
    --  Given a declaration N, returns the associated defining entity. If the
    --  declaration has a specification, the entity is obtained from the
    --  specification. If the declaration has a defining unit name, then the
@@ -487,19 +485,6 @@ package Sem_Util is
    --  local entities declared during loop expansion. These entities need
    --  debugging information, generated through Qualify_Entity_Names, and
    --  the loop declaration must be placed in the table Name_Qualify_Units.
-   --
-   --  Set flag Empty_On_Error to change the behavior of this routine as
-   --  follows:
-   --
-   --    * True  - A declaration that lacks a defining entity returns Empty.
-   --      A node that does not allow for a defining entity returns Empty.
-   --
-   --    * False - A declaration that lacks a defining entity is given a new
-   --      internally generated entity which is subsequently returned. A node
-   --      that does not allow for a defining entity raises Program_Error.
-   --
-   --  The former semantics is appropriate for the back end; the latter
-   --  semantics is appropriate for the front end.
 
    function Denotes_Discriminant
      (N                : Node_Id;