Routine Set_Entity_With_Checks called Set_Entity, did some checks, and
then called Set_Entity again. This second call was redundant and had no
effect; this patch removes it.

Those two calls appear to come from a sequence of refactorings:
initially there was just a call to Set_Entity at the end; when a return
statement was introduced in the checks part, then the call at the
beginning was added and the call at the end was forgotten to be removed.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_ch4.adb (Indicate_Name_And_Type): Fix whitespace in
        comment.
        * sem_res.adb (Resolve_Call): Remove redundant parens.
        * sem_util.adb (Set_Entity_With_Checks): Remove extra call to
        Set_Entity.
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -3414,7 +3414,7 @@ package body Sem_Ch4 is
          Success := True;
 
          --  If the prefix of the call is a name, indicate the entity
-         --  being called. If it is not a name,  it is an expression that
+         --  being called. If it is not a name, it is an expression that
          --  denotes an access to subprogram or else an entry or family. In
          --  the latter case, the name is a selected component, and the entity
          --  being called is noted on the selector.


diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -6293,7 +6293,7 @@ package body Sem_Res is
 
       --  Normal subprogram call with name established in Resolve
 
-      elsif not (Is_Type (Entity (Subp))) then
+      elsif not Is_Type (Entity (Subp)) then
          Nam := Entity (Subp);
          Set_Entity_With_Checks (Subp, Nam);
 


diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -27600,8 +27600,6 @@ package body Sem_Util is
             Style.Check_Identifier (Nod, Val_Actual);
          end if;
       end if;
-
-      Set_Entity (N, Val);
    end Set_Entity_With_Checks;
 
    ------------------------------


Reply via email to