aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-06-23 11:23:47 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-06-23 11:23:47 +0200
commit87dc09cbb83422854550aa1f33dd7ac430351300 (patch)
treed7678f3b2127c113aa182e53139cdc15e0bdac2f
parent9a0ddeee0fbd6daf3d98ef415bdc4535b272aff8 (diff)
downloadgcc-87dc09cbb83422854550aa1f33dd7ac430351300.zip
gcc-87dc09cbb83422854550aa1f33dd7ac430351300.tar.gz
gcc-87dc09cbb83422854550aa1f33dd7ac430351300.tar.bz2
[multiple changes]
2010-06-23 Robert Dewar <dewar@adacore.com> * sem_ch5.adb (Process_Bounds): Remove some junk initializations. * sem_res.adb: Add comments. * sem_util.adb: Minor reformatting. Add comments. Change increment on Actuals_In_Call table. * opt.ads: Minor: add 'constant'. 2010-06-23 Javier Miranda <miranda@adacore.com> * exp_disp.adb (Make_DT): Initialize the Size_Func component of the TSD to Null_Address if No_Dispatching_Calls is active. 2010-06-23 Vincent Celier <celier@adacore.com> * a-comlin.ads: Indicate that use of this package is not supported during the elaboration of an auto-initialized Stand-Alone Library. 2010-06-23 Ed Schonberg <schonberg@adacore.com> * exp_util.adb (Is_Possibly_Misaligned_Object): Do not rely on an alignment clause on a record type to determine if a component may be misaligned. The decision must be taken in the back-end where target alignment information is known. 2010-06-23 Arnaud Charlet <charlet@adacore.com> * gnat1drv.adb (Adjust_Global_Switches): Enable some restrictions systematically in CodePeer mode to simplify generated code. * restrict.adb (Check_Restriction): Do nothing in CodePeer mode. * exp_ch4.adb (Expand_N_Allocator): Generate proper code when No_Task_Hierarchy is set instead of crasshing. From-SVN: r161265
-rw-r--r--gcc/ada/ChangeLog33
-rw-r--r--gcc/ada/a-comlin.ads5
-rw-r--r--gcc/ada/exp_ch4.adb15
-rw-r--r--gcc/ada/exp_disp.adb13
-rw-r--r--gcc/ada/exp_util.adb23
-rw-r--r--gcc/ada/gnat1drv.adb13
-rw-r--r--gcc/ada/opt.ads2
-rw-r--r--gcc/ada/restrict.adb8
-rw-r--r--gcc/ada/sem_ch5.adb4
-rw-r--r--gcc/ada/sem_res.adb2
-rw-r--r--gcc/ada/sem_util.adb19
11 files changed, 105 insertions, 32 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 12e60cc..00e199b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,36 @@
+2010-06-23 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch5.adb (Process_Bounds): Remove some junk initializations.
+ * sem_res.adb: Add comments.
+ * sem_util.adb: Minor reformatting. Add comments.
+ Change increment on Actuals_In_Call table.
+ * opt.ads: Minor: add 'constant'.
+
+2010-06-23 Javier Miranda <miranda@adacore.com>
+
+ * exp_disp.adb (Make_DT): Initialize the Size_Func component of the
+ TSD to Null_Address if No_Dispatching_Calls is active.
+
+2010-06-23 Vincent Celier <celier@adacore.com>
+
+ * a-comlin.ads: Indicate that use of this package is not supported
+ during the elaboration of an auto-initialized Stand-Alone Library.
+
+2010-06-23 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_util.adb (Is_Possibly_Misaligned_Object): Do not rely on an
+ alignment clause on a record type to determine if a component may be
+ misaligned. The decision must be taken in the back-end where target
+ alignment information is known.
+
+2010-06-23 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat1drv.adb (Adjust_Global_Switches): Enable some restrictions
+ systematically in CodePeer mode to simplify generated code.
+ * restrict.adb (Check_Restriction): Do nothing in CodePeer mode.
+ * exp_ch4.adb (Expand_N_Allocator): Generate proper code when
+ No_Task_Hierarchy is set instead of crasshing.
+
2010-06-23 Thomas Quinot <quinot@adacore.com>
* sem_util.adb: Minor code cleanup: test for proper entity instead of
diff --git a/gcc/ada/a-comlin.ads b/gcc/ada/a-comlin.ads
index 8d66e15..55d0a50 100644
--- a/gcc/ada/a-comlin.ads
+++ b/gcc/ada/a-comlin.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -73,6 +73,9 @@ package Ada.Command_Line is
-- Note on Interface Requirements --
------------------------------------
+ -- Services in this package are not supported during the elaboration of an
+ -- auto-initialized Stand-Alone Library.
+
-- If the main program is in Ada, this package works as specified without
-- any other work than the normal steps of WITH'ing the package and then
-- calling the desired routines.
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index cf9f8d7..5cbcc39 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -3689,16 +3689,23 @@ package body Exp_Ch4 is
Decls := Build_Task_Image_Decls (Loc, T, T);
end if;
- Append_To (Args,
- New_Reference_To
- (Master_Id (Base_Type (Root_Type (PtrT))), Loc));
+ -- What is this constant 3 below, should have a name ???
+
+ if Restriction_Active (No_Task_Hierarchy) then
+ Append_To (Args, Make_Integer_Literal (Loc, 3));
+ else
+ Append_To (Args,
+ New_Reference_To
+ (Master_Id (Base_Type (Root_Type (PtrT))), Loc));
+ end if;
+
Append_To (Args, Make_Identifier (Loc, Name_uChain));
Decl := Last (Decls);
Append_To (Args,
New_Occurrence_Of (Defining_Identifier (Decl), Loc));
- -- Has_Task is false, Decls not used
+ -- Has_Task is false, Decls not used
else
Decls := No_List;
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index fbc6ddb..7599a25 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -4859,9 +4859,14 @@ package body Exp_Disp is
-- Size_Func
if RTE_Record_Component_Available (RE_Size_Func) then
- if not Building_Static_DT (Typ)
- or else Is_Interface (Typ)
- then
+
+ -- Initialize this field to Null_Address if we are not building
+ -- static dispatch tables static or if the size function is not
+ -- available. In the former case we cannot initialize this field
+ -- until the function is frozen and registered in the dispatch
+ -- table (see Register_Primitive).
+
+ if not Building_Static_DT (Typ) or else not Has_DT (Typ) then
Append_To (TSD_Aggr_List,
Unchecked_Convert_To (RTE (RE_Size_Ptr),
New_Reference_To (RTE (RE_Null_Address), Loc)));
@@ -5871,7 +5876,7 @@ package body Exp_Disp is
-- Mark entities containing dispatch tables. Required by the backend to
-- handle them properly.
- if not Is_Interface (Typ) then
+ if Has_DT (Typ) then
declare
Elmt : Elmt_Id;
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 61eef35..b9e5d38 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -3142,16 +3142,23 @@ package body Exp_Util is
end if;
end if;
+ -- The following code is historical, it used to be present but it
+ -- is too cautious, because the front-end does not know the proper
+ -- default alignments for the target. Also, if the alignment is
+ -- not known, the front end can't know in any case! If a copy is
+ -- needed, the back-end will take care of it. This whole section
+ -- including this comment can be removed later ???
+
-- If the component reference is for a record that has a specified
-- alignment, and we either know it is too small, or cannot tell,
- -- then the component may be unaligned
-
- if Known_Alignment (Etype (P))
- and then Alignment (Etype (P)) < Ttypes.Maximum_Alignment
- and then M > Alignment (Etype (P))
- then
- return True;
- end if;
+ -- then the component may be unaligned.
+
+ -- if Known_Alignment (Etype (P))
+ -- and then Alignment (Etype (P)) < Ttypes.Maximum_Alignment
+ -- and then M > Alignment (Etype (P))
+ -- then
+ -- return True;
+ -- end if;
-- Case of component clause present which may specify an
-- unaligned position.
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index c49b307..d3d15cc 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -50,6 +50,7 @@ with Par_SCO;
with Prepcomp;
with Repinfo; use Repinfo;
with Restrict;
+with Rident; use Rident;
with Rtsfind;
with SCOs;
with Sem;
@@ -169,12 +170,14 @@ procedure Gnat1drv is
Optimization_Level := 0;
- -- Disable specific expansions for Restrictions pragmas to avoid
- -- tree inconsistencies between compilations with different pragmas
- -- that will cause different SCIL files to be generated for the
- -- same Ada spec.
+ -- Enable some restrictions systematically to simplify the generated
+ -- code (and ease analysis). Note that restriction checks are also
+ -- disabled in CodePeer_Mode, see Restrict.Check_Restriction
- Treat_Restrictions_As_Warnings := 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;
-- Suppress overflow, division by zero and access checks since they
-- are handled implicitly by CodePeer.
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index cac20fb..8758b30 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -72,7 +72,7 @@ package Opt is
-- which we want to allow, so that things work OK when Ada_15 is added!
-- This warning is now removed, so this pragma can be removed some time???
- Ada_Version_Default : Ada_Version_Type := Ada_05;
+ Ada_Version_Default : constant Ada_Version_Type := Ada_05;
-- GNAT
-- Default Ada version if no switch given
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb
index eaae4db..f7d97ba 100644
--- a/gcc/ada/restrict.adb
+++ b/gcc/ada/restrict.adb
@@ -256,6 +256,14 @@ package body Restrict is
-- Start of processing for Check_Restriction
begin
+ -- In CodePeer mode, we do not want to check for any restriction, or
+ -- set additional restrictions than those already set in gnat1drv.adb
+ -- so that we have consistency between each compilation.
+
+ if CodePeer_Mode then
+ return;
+ end if;
+
if UI_Is_In_Int_Range (V) then
VV := Integer (UI_To_Int (V));
else
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 6867940..816e12b 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -1474,8 +1474,8 @@ package body Sem_Ch5 is
R_Copy : constant Node_Id := New_Copy_Tree (R);
Lo : constant Node_Id := Low_Bound (R);
Hi : constant Node_Id := High_Bound (R);
- New_Lo_Bound : Node_Id := Empty;
- New_Hi_Bound : Node_Id := Empty;
+ New_Lo_Bound : Node_Id;
+ New_Hi_Bound : Node_Id;
Typ : Entity_Id;
Save_Analysis : Boolean;
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 33b48d6..9a60898 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -3479,6 +3479,7 @@ package body Sem_Res is
-- Save_Actual (A,
-- Ekind (F) /= E_In_Parameter or else Is_Access_Type (F_Typ));
+ -- Why is this code commented out ???
-- For mode IN, if actual is an entity, and the type of the formal
-- has warnings suppressed, then we reset Never_Set_In_Source for
@@ -7976,6 +7977,7 @@ package body Sem_Res is
R : constant Node_Id := Right_Opnd (N);
begin
+ -- Why are the calls to Check_Order_Dependence commented out ???
Resolve (L, B_Typ);
-- Check_Order_Dependence; -- For AI05-0144
Resolve (R, B_Typ);
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 6339e3e..e846845 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -116,7 +116,7 @@ package body Sem_Util is
Table_Index_Type => Int,
Table_Low_Bound => 0,
Table_Initial => 10,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Actuals");
-----------------------
@@ -1174,8 +1174,12 @@ package body Sem_Util is
----------------------------
procedure Check_Order_Dependence is
- Act1, Act2 : Node_Id;
+ Act1 : Node_Id;
+ Act2 : Node_Id;
+
begin
+ -- This could use comments ???
+
for J in 0 .. Actuals_In_Call.Last loop
if Actuals_In_Call.Table (J).Is_Writable then
Act1 := Actuals_In_Call.Table (J).Act;
@@ -1187,6 +1191,7 @@ package body Sem_Util is
for K in 0 .. Actuals_In_Call.Last loop
if K /= J then
Act2 := Actuals_In_Call.Table (K).Act;
+
if Nkind (Act2) = N_Attribute_Reference then
Act2 := Prefix (Act2);
end if;
@@ -10580,11 +10585,11 @@ package body Sem_Util is
procedure Save_Actual (N : Node_Id; Writable : Boolean := False) is
begin
if Is_Entity_Name (N)
- or else
- Nkind_In (N, N_Indexed_Component, N_Selected_Component, N_Slice)
- or else
- (Nkind (N) = N_Attribute_Reference
- and then Attribute_Name (N) = Name_Access)
+ or else
+ Nkind_In (N, N_Indexed_Component, N_Selected_Component, N_Slice)
+ or else
+ (Nkind (N) = N_Attribute_Reference
+ and then Attribute_Name (N) = Name_Access)
then
-- We are only interested in IN OUT parameters of inner calls