aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-04 15:38:32 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-04 15:38:32 +0200
commit477bd7327382b6ede20880a808945e4e93ce34a5 (patch)
tree23c9ed87b7402730b99a9046180d3c16a302e450 /gcc
parentea4ce0f7775af81231269f9c39206db30b7cb775 (diff)
downloadgcc-477bd7327382b6ede20880a808945e4e93ce34a5.zip
gcc-477bd7327382b6ede20880a808945e4e93ce34a5.tar.gz
gcc-477bd7327382b6ede20880a808945e4e93ce34a5.tar.bz2
[multiple changes]
2010-10-04 Robert Dewar <dewar@adacore.com> * sem_res.adb, sinput-l.adb: Minor reformatting. 2010-10-04 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch5.adb (Expand_N_Assignment_Statement): Do not generate a tag check when the target object is an interface since the expression of the right hand side must only cover the interface. From-SVN: r164935
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/exp_ch5.adb6
-rw-r--r--gcc/ada/sem_res.adb4
-rw-r--r--gcc/ada/sinput-l.adb13
4 files changed, 25 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0c292b9..226f740 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-04 Robert Dewar <dewar@adacore.com>
+
+ * sem_res.adb, sinput-l.adb: Minor reformatting.
+
+2010-10-04 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch5.adb (Expand_N_Assignment_Statement): Do not generate a tag
+ check when the target object is an interface since the expression of
+ the right hand side must only cover the interface.
+
2010-10-04 Vincent Celier <celier@adacore.com>
* frontend.adb: Set Lib.Parsing_Main_Extended_Source to True before
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 8760cb7..6c7c8ce 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1956,6 +1956,12 @@ package body Exp_Ch5 is
if Is_Class_Wide_Type (Typ)
and then Is_Tagged_Type (Typ)
and then Is_Tagged_Type (Underlying_Type (Etype (Rhs)))
+
+ -- Do not generate a tag check when the target object is
+ -- an interface since the expression of the right hand
+ -- side must only cover the interface.
+
+ and then not Is_Interface (Typ)
then
Append_To (L,
Make_Raise_Constraint_Error (Loc,
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index fa0b66b..c019c30 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -8826,9 +8826,9 @@ package body Sem_Res is
(Etype (Entity (Orig_N)) = Orig_T
or else
(Ekind (Entity (Orig_N)) = E_Loop_Parameter
- and then Covers (Orig_T, Etype (Entity (Orig_N))))))
+ and then Covers (Orig_T, Etype (Entity (Orig_N))))))
- -- If not an entity, then type of expression must match
+ -- If not an entity, then type of expression must match
or else Etype (Orig_N) = Orig_T
then
diff --git a/gcc/ada/sinput-l.adb b/gcc/ada/sinput-l.adb
index 8d952b2..52f3a71 100644
--- a/gcc/ada/sinput-l.adb
+++ b/gcc/ada/sinput-l.adb
@@ -556,13 +556,14 @@ package body Sinput.L is
-- the source has been modified by the preprocessing. Only
-- do that for the main unit (spec, body and subunits).
- if Generate_Processed_File and then
- Modified and then
+ if Generate_Processed_File
+ and then Modified
+ and then
((Compiler_State = Parsing
- and then Parsing_Main_Extended_Source)
- or else
- (Compiler_State = Analyzing
- and then Analysing_Subunit_Of_Main))
+ and then Parsing_Main_Extended_Source)
+ or else
+ (Compiler_State = Analyzing
+ and then Analysing_Subunit_Of_Main))
then
declare
FD : File_Descriptor;