decl.c (cannot_be_superflat_p): Handle Signed_Integer_Type_Definition Scalar_Ranges.
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
This commit is contained in:
parent
638381579b
commit
683ebd7553
@ -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
|
||||
|
@ -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))
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user