summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 10:46:27 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 10:46:27 +0000
commit084c30734d0a8ff89cdd540cf419e4b1ee021798 (patch)
tree3b564c9735e23e369354db53fdf6f01c517ec7ae
parenteae24905eccc0bdf7164228a8ce94f4bcd0bfa3e (diff)
downloadgcc-084c30734d0a8ff89cdd540cf419e4b1ee021798.tar.gz
2015-10-23 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Adjust settings. * sem.adb (Semantics): Remove special case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229230 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gnat1drv.adb24
-rw-r--r--gcc/ada/restrict.adb6
-rw-r--r--gcc/ada/sem.adb4
4 files changed, 28 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5235631e069..b66d29ff12b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-23 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat1drv.adb (Adjust_Global_Switches): Adjust settings.
+ * sem.adb (Semantics): Remove special case.
+
2015-10-23 Gary Dismukes <dismukes@adacore.com>
* bindgen.adb, restrict.adb: Minor spelling/grammar fixes.
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index bd3af2ef271..88cc9c0b8b0 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -136,17 +136,34 @@ procedure Gnat1drv is
Unnest_Subprogram_Mode := True;
end if;
- -- -gnatd.V or -gnatd.u enables special C expansion mode
+ -- -gnatd.u enables special C expansion mode
- if Debug_Flag_Dot_VV or Debug_Flag_Dot_U then
+ if Debug_Flag_Dot_U then
Modify_Tree_For_C := True;
end if;
- -- Other flags set if we are generating C code
+ -- Set all flags required when generating C code (-gnatd.V)
if Debug_Flag_Dot_VV then
Generate_C_Code := True;
+ Modify_Tree_For_C := True;
Unnest_Subprogram_Mode := True;
+
+ -- Enable some restrictions systematically to simplify the generated
+ -- code. Note that restriction checks are also disabled in C mode,
+ -- see Restrict.Check_Restriction.
+
+ Restrict.Restrictions.Set (No_Exception_Registration) := True;
+ Restrict.Restrictions.Set (No_Initialize_Scalars) := True;
+ Restrict.Restrictions.Set (No_Task_Hierarchy) := True;
+ Restrict.Restrictions.Set (No_Abort_Statements) := True;
+ Restrict.Restrictions.Set (Max_Asynchronous_Select_Nesting) := True;
+ Restrict.Restrictions.Value (Max_Asynchronous_Select_Nesting) := 0;
+
+ -- Set operating mode to Generate_Code to benefit from full front-end
+ -- expansion (e.g. generics).
+
+ Operating_Mode := Generate_Code;
end if;
-- -gnatd.E sets Error_To_Warning mode, causing selected error messages
@@ -229,6 +246,7 @@ procedure Gnat1drv is
-- user specified Restrictions pragmas are ignored, see
-- Sem_Prag.Process_Restrictions_Or_Restriction_Warnings.
+ Restrict.Restrictions.Set (No_Exception_Registration) := True;
Restrict.Restrictions.Set (No_Initialize_Scalars) := True;
Restrict.Restrictions.Set (No_Task_Hierarchy) := True;
Restrict.Restrictions.Set (No_Abort_Statements) := True;
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb
index b63b426d096..aaaaf40bb0a 100644
--- a/gcc/ada/restrict.adb
+++ b/gcc/ada/restrict.adb
@@ -505,16 +505,14 @@ package body Restrict is
-- In GNATprove mode restrictions are checked, except for
-- No_Initialize_Scalars, which is implicitly set in gnat1drv.adb.
- -- Just checking, SPARK does not allow restrictions to be set ???
-
if CodePeer_Mode
or else (GNATprove_Mode and then R = No_Initialize_Scalars)
then
return;
end if;
- -- In SPARK mode, issue an error for any use of class-wide, even if the
- -- No_Dispatch restriction is not set.
+ -- In SPARK 05 mode, issue an error for any use of class-wide, even if
+ -- the No_Dispatch restriction is not set.
if R = No_Dispatch then
Check_SPARK_05_Restriction ("class-wide is not allowed", N);
diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb
index a6f1be13b3b..819bcd5d959 100644
--- a/gcc/ada/sem.adb
+++ b/gcc/ada/sem.adb
@@ -1446,10 +1446,6 @@ package body Sem is
or else Debug_Flag_X
- -- Or if we are generating C code
-
- or else Generate_C_Code
-
-- Or if in configuration run-time mode. We do this so we get
-- error messages about missing entities in the run-time even
-- if we are compiling in -gnatc (no code generation) mode.