]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (cannot_be_superflat_p): Handle Signed_Integer_Type_Definition Scalar_Ranges.
authorOlivier Hainque <hainque@adacore.com>
Wed, 2 Sep 2009 12:13:37 +0000 (12:13 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Wed, 2 Sep 2009 12:13:37 +0000 (12:13 +0000)
        ada/
        * gcc-interface/decl.c (cannot_be_superflat_p): Handle
        Signed_Integer_Type_Definition Scalar_Ranges.

        testsuite/
        * gnat.dg/array7.ad[bs]: Add check for Signed_Integer_Type_Definition.

From-SVN: r151322

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/testsuite/ChangeLog

index a37d1c06ce5fc50c21b75a8ae6645864e3edef55..aab6b98096337031547345c75e7e75cfa7a8529b 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-02  Olivier Hainque  <hainque@adacore.com>
+
+       * gcc-interface/decl.c (cannot_be_superflat_p): Handle
+       Signed_Integer_Type_Definition Scalar_Ranges.
+
 2009-09-02  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/trans.c (gnat_gimplify_expr) <ADDR_EXPR>: Gimplify the
index 7d96c9a3c6d09d90658cb6c5798eba127b5f7224..9d385302c6bdda0ed967967b8501adfee348cd81 100644 (file)
@@ -5298,21 +5298,27 @@ static bool
 cannot_be_superflat_p (Node_Id gnat_range)
 {
   Node_Id gnat_lb = Low_Bound (gnat_range), gnat_hb = High_Bound (gnat_range);
+  Node_Id scalar_range;
+
   tree gnu_lb, gnu_hb;
 
   /* If the low bound is not constant, try to find an upper bound.  */
   while (Nkind (gnat_lb) != N_Integer_Literal
         && (Ekind (Etype (gnat_lb)) == E_Signed_Integer_Subtype
             || Ekind (Etype (gnat_lb)) == E_Modular_Integer_Subtype)
-        && Nkind (Scalar_Range (Etype (gnat_lb))) == N_Range)
-    gnat_lb = High_Bound (Scalar_Range (Etype (gnat_lb)));
+        && (scalar_range = Scalar_Range (Etype (gnat_lb)))
+        && (Nkind (scalar_range) == N_Signed_Integer_Type_Definition
+            || Nkind (scalar_range) == N_Range))
+    gnat_lb = High_Bound (scalar_range);
 
   /* If the high bound is not constant, try to find a lower bound.  */
   while (Nkind (gnat_hb) != N_Integer_Literal
         && (Ekind (Etype (gnat_hb)) == E_Signed_Integer_Subtype
             || Ekind (Etype (gnat_hb)) == E_Modular_Integer_Subtype)
-        && Nkind (Scalar_Range (Etype (gnat_hb))) == N_Range)
-    gnat_hb = Low_Bound (Scalar_Range (Etype (gnat_hb)));
+        && (scalar_range = Scalar_Range (Etype (gnat_hb)))
+        && (Nkind (scalar_range) == N_Signed_Integer_Type_Definition
+            || Nkind (scalar_range) == N_Range))
+    gnat_hb = Low_Bound (scalar_range);
 
   if (!(Nkind (gnat_lb) == N_Integer_Literal
        && Nkind (gnat_hb) == N_Integer_Literal))
index 1d1679002f74a9cd588ed8bc73ee81865ded5150..3e331d98ed8f31aa249c18e0d38469538a79c1bf 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-02  Olivier Hainque  <hainque@adacore.com>
+
+       * gnat.dg/array7.ad[bs]: Add check for Signed_Integer_Type_Definition.
+       
 2009-09-02  Eric Botcazou  <ebotcazou@adacore.com>
             Olivier Hainque  <hainque@adacore.com>