[COMMITTED] ada: Minor tweak in assertion

Message ID 20221121101437.259534-1-poulhies@adacore.com
State New
Headers
Series [COMMITTED] ada: Minor tweak in assertion |

Commit Message

Marc Poulhiès Nov. 21, 2022, 10:14 a.m. UTC
  From: Eric Botcazou <ebotcazou@adacore.com>

For an array subtype, being definite is the same as being constrained.

gcc/ada/

	* sem_util.adb (Needs_Secondary_Stack): Test Is_Constrained
	directly instead of Is_Definite_Subtype for an array subtype.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_util.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 67baf7abfad..f331b4b78ba 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -23634,7 +23634,7 @@  package body Sem_Util is
       --  Unconstrained array type
 
       else
-         pragma Assert (Is_Array_Type (Typ) and not Is_Definite_Subtype (Typ));
+         pragma Assert (Is_Array_Type (Typ) and then not Is_Constrained (Typ));
          return True;
       end if;
    end Needs_Secondary_Stack;