summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch5.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-08 15:26:55 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-08 15:26:55 +0000
commit2fffb07a72d0755a559b08cfa30eb12d277daec1 (patch)
tree20d56621348a3b110462868858912c7fa9c996f0 /gcc/ada/exp_ch5.adb
parent00d899d593b3ee0b57d64166bcbdb2c34bc40f0d (diff)
downloadgcc-2fffb07a72d0755a559b08cfa30eb12d277daec1.tar.gz
2013-02-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 195888 using svnmerge.py git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@195892 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch5.adb')
-rw-r--r--gcc/ada/exp_ch5.adb16
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 2bdb82797ab..243279b00fc 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1754,13 +1754,18 @@ package body Exp_Ch5 is
declare
Loop_Spec : constant Node_Id :=
Loop_Parameter_Specification (Scheme);
- Subt_Def : constant Node_Id :=
- Discrete_Subtype_Definition (Loop_Spec);
Cond : Node_Id;
+ Subt_Def : Node_Id;
begin
- -- At this point in the expansion all discrete subtype definitions
- -- should be transformed into ranges.
+ Subt_Def := Discrete_Subtype_Definition (Loop_Spec);
+
+ -- When the loop iterates over a subtype indication with a range,
+ -- use the low and high bounds of the subtype itself.
+
+ if Nkind (Subt_Def) = N_Subtype_Indication then
+ Subt_Def := Scalar_Range (Etype (Subt_Def));
+ end if;
pragma Assert (Nkind (Subt_Def) = N_Range);
@@ -2471,7 +2476,8 @@ package body Exp_Ch5 is
-- the assignment we generate run-time check to ensure that
-- the tags of source and target match.
- if Is_Class_Wide_Type (Typ)
+ if not Tag_Checks_Suppressed (Typ)
+ and then Is_Class_Wide_Type (Typ)
and then Is_Tagged_Type (Typ)
and then Is_Tagged_Type (Underlying_Type (Etype (Rhs)))
then