]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Small improvement to Null_Status function
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 26 Oct 2023 08:43:38 +0000 (10:43 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 21 Nov 2023 09:57:41 +0000 (10:57 +0100)
The function is used to optimize away access checks.

gcc/ada/

* sem_util.adb (Null_Status): Deal with unchecked type conversions.

gcc/ada/sem_util.adb

index 3d870b1049c5149b81de9602c66e70b32eaffd55..eb2d83a4d6d3171f99f4248a65311ece3221f19a 100644 (file)
@@ -25429,7 +25429,7 @@ package body Sem_Util is
 
       --  Check the status of the operand of a type conversion
 
-      elsif Nkind (N) = N_Type_Conversion then
+      elsif Nkind (N) in N_Type_Conversion | N_Unchecked_Type_Conversion then
          return Null_Status (Expression (N));
 
       --  The input denotes a reference to an entity. Determine whether the