OSDN Git Service

ada/
authorhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Sep 2009 12:13:37 +0000 (12:13 +0000)
committerhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Sep 2009 12:13:37 +0000 (12:13 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151322 138bc75d-0d04-0410-961f-82ee72b054a4

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

index a37d1c0..aab6b98 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 7d96c9a..9d38530 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 1d16790..3e331d9 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>