summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-02 12:13:37 +0000
committerhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-02 12:13:37 +0000
commit7acc347ee5888d93283457ced4a914766b7ab0ab (patch)
tree1d92be14b5a112780ad63f8695c1a71f6b98e35d
parentf85fb8196d7727fb5c14a7fa86dd7ab7768b5812 (diff)
downloadppe42-gcc-7acc347ee5888d93283457ced4a914766b7ab0ab.tar.gz
ppe42-gcc-7acc347ee5888d93283457ced4a914766b7ab0ab.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151322 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/decl.c14
-rw-r--r--gcc/testsuite/ChangeLog4
3 files changed, 19 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index a37d1c06ce5..aab6b980963 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 7d96c9a3c6d..9d385302c6b 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -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))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1d1679002f7..3e331d98ed8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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>
OpenPOWER on IntegriCloud