summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-06 10:47:21 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-06 10:47:21 +0000
commitd849845a3e51124fe358eab98d0cc700e6a9fe2a (patch)
tree991415545ba8f2db4c910d88f75002e82164a999
parent704b4aa5034b6b00d087d39761336f975727009c (diff)
downloadgcc-d849845a3e51124fe358eab98d0cc700e6a9fe2a.tar.gz
2012-11-06 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Preanalyze_And_Resolve): In Alfa mode do not disable checks, so that flags can be properly set on expressions that are not further expanded. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193231 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_res.adb26
2 files changed, 28 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d2ad5416b29..cfa05a20601 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_res.adb (Preanalyze_And_Resolve): In Alfa mode do not
+ disable checks, so that flags can be properly set on expressions
+ that are not further expanded.
+
2012-11-06 Robert Dewar <dewar@adacore.com>
* exp_attr.adb, sem_attr.adb: Minor reformatting.
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index defe37f3d4c..847dd30c126 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -1379,6 +1379,13 @@ package body Sem_Res is
if Nkind (Name (N)) = N_Expanded_Name then
Pack := Entity (Prefix (Name (N)));
+ -- If this is a package renaming, get renamed entity, which will be
+ -- the scope of the operands if operaton is type-correct.
+
+ if Present (Renamed_Entity (Pack)) then
+ Pack := Renamed_Entity (Pack);
+ end if;
+
-- If the entity being called is defined in the given package, it is
-- a renaming of a predefined operator, and known to be legal.
@@ -1683,11 +1690,22 @@ package body Sem_Res is
Full_Analysis := False;
Expander_Mode_Save_And_Set (False);
- -- We suppress all checks for this analysis, since the checks will
- -- be applied properly, and in the right location, when the default
- -- expression is reanalyzed and reexpanded later on.
+ -- We suppress all checks for this analysis, except in Alfa mode.
+ -- Otherwise the checks are applied properly, and in the proper
+ -- location, when the default expressions are reanalyzed and reexpanded
+ -- later on.
+
+ -- Alfa mode suppresses all expansion but requires the setting of
+ -- checking flags (DIvision_Check and others) in particular for Ada 2012
+ -- constructs such as quantified expressions, that are expanded in two
+ -- separate steps.
- Analyze_And_Resolve (N, T, Suppress => All_Checks);
+ if Alfa_Mode then
+ Analyze_And_Resolve (N, T);
+
+ else
+ Analyze_And_Resolve (N, T, Suppress => All_Checks);
+ end if;
Expander_Mode_Restore;
Full_Analysis := Save_Full_Analysis;