summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/ChangeLog35
-rw-r--r--gcc/ada/a-cbdlli.adb16
-rw-r--r--gcc/ada/a-cdlili.adb16
-rw-r--r--gcc/ada/a-cidlli.adb16
-rw-r--r--gcc/ada/a-cobove.adb18
-rw-r--r--gcc/ada/a-coinve.adb18
-rw-r--r--gcc/ada/a-convec.adb18
-rw-r--r--gcc/ada/exp_attr.adb6
-rw-r--r--gcc/ada/exp_ch4.adb7
-rw-r--r--gcc/ada/exp_ch5.adb17
-rw-r--r--gcc/ada/gnat_rm.texi4
-rw-r--r--gcc/ada/gnat_ugn.texi4
-rw-r--r--gcc/ada/par-labl.adb5
13 files changed, 149 insertions, 31 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index be2dceaf794..7924c40afed 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,38 @@
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * gnat_rm.texi: Minor reformatting.
+
+2011-11-04 Matthew Heaney <heaney@adacore.com>
+
+ * a-convec.adb, a-coinve.adb, a-cobove.adb (Merge): Raise PE
+ when Target and Source denote same non-empty object
+ * a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb (Merge): Ditto
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_attr.adb: Minor reformatting.
+
+2011-11-04 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch5.adb (Expand_Assign_Record): Do not generate a
+ discriminant assignment within an initialization proc if the
+ record is an unchecked union, as it can only come from the
+ initialization of an unchecked union component.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Minor reformatting.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * par-labl.adb (Rewrite_As_Loop): Generate info msg rather than
+ warning message.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb: Minor code reorganization (remove junk obsolete
+ var Save_Space).
+
2011-11-04 Hristian Kirtchev <kirtchev@adacore.com>
* exp_alfa.adb: Add local constant
diff --git a/gcc/ada/a-cbdlli.adb b/gcc/ada/a-cbdlli.adb
index 1b10d42b4a3..e1f7725d5cd 100644
--- a/gcc/ada/a-cbdlli.adb
+++ b/gcc/ada/a-cbdlli.adb
@@ -713,10 +713,24 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
LI, RI : Cursor;
begin
- if Target'Address = Source'Address then
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Is_Empty then
return;
end if;
+ if Target'Address = Source'Address then
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
+ end if;
+
if Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
diff --git a/gcc/ada/a-cdlili.adb b/gcc/ada/a-cdlili.adb
index 326c74b0785..8b513222ef8 100644
--- a/gcc/ada/a-cdlili.adb
+++ b/gcc/ada/a-cdlili.adb
@@ -515,10 +515,24 @@ package body Ada.Containers.Doubly_Linked_Lists is
LI, RI : Cursor;
begin
- if Target'Address = Source'Address then
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Is_Empty then
return;
end if;
+ if Target'Address = Source'Address then
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
+ end if;
+
if Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
diff --git a/gcc/ada/a-cidlli.adb b/gcc/ada/a-cidlli.adb
index 42bd3c48313..dbdc6de47d4 100644
--- a/gcc/ada/a-cidlli.adb
+++ b/gcc/ada/a-cidlli.adb
@@ -563,10 +563,24 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
LI, RI : Cursor;
begin
- if Target'Address = Source'Address then
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Is_Empty then
return;
end if;
+ if Target'Address = Source'Address then
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
+ end if;
+
if Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
diff --git a/gcc/ada/a-cobove.adb b/gcc/ada/a-cobove.adb
index 16d465d5f0e..e78e3ce12d3 100644
--- a/gcc/ada/a-cobove.adb
+++ b/gcc/ada/a-cobove.adb
@@ -788,16 +788,26 @@ package body Ada.Containers.Bounded_Vectors is
I, J : Count_Type;
begin
- if Target.Is_Empty then
- Move (Target => Target, Source => Source);
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Is_Empty then
return;
end if;
if Target'Address = Source'Address then
- return;
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
end if;
- if Source.Is_Empty then
+ if Target.Is_Empty then
+ Move (Target => Target, Source => Source);
return;
end if;
diff --git a/gcc/ada/a-coinve.adb b/gcc/ada/a-coinve.adb
index ae72e65ed51..e35f2f781de 100644
--- a/gcc/ada/a-coinve.adb
+++ b/gcc/ada/a-coinve.adb
@@ -1268,16 +1268,26 @@ package body Ada.Containers.Indefinite_Vectors is
I, J : Index_Type'Base;
begin
- if Target.Last < Index_Type'First then
- Move (Target => Target, Source => Source);
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Last < Index_Type'First then -- Source is empty
return;
end if;
if Target'Address = Source'Address then
- return;
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
end if;
- if Source.Last < Index_Type'First then
+ if Target.Last < Index_Type'First then -- Target is empty
+ Move (Target => Target, Source => Source);
return;
end if;
diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb
index b18de68a737..79071810182 100644
--- a/gcc/ada/a-convec.adb
+++ b/gcc/ada/a-convec.adb
@@ -909,16 +909,26 @@ package body Ada.Containers.Vectors is
J : Index_Type'Base;
begin
- if Target.Last < Index_Type'First then
- Move (Target => Target, Source => Source);
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Last < Index_Type'First then -- Source is empty
return;
end if;
if Target'Address = Source'Address then
- return;
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
end if;
- if Source.Last < Index_Type'First then
+ if Target.Last < Index_Type'First then -- Target is empty
+ Move (Target => Target, Source => Source);
return;
end if;
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index db8f6a30d5d..57e94d29840 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -4046,13 +4046,13 @@ package body Exp_Attr is
X : constant Node_Id := Prefix (N);
Y : constant Node_Id := First (Expressions (N));
- -- The argumens
+ -- The arguments
X_Addr, Y_Addr : Node_Id;
- -- the expressions for their addresses
+ -- Rhe expressions for their addresses
X_Size, Y_Size : Node_Id;
- -- the expressions for their sizes
+ -- Rhe expressions for their sizes
begin
-- The attribute is expanded as:
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 8f2b86543db..d2f0668873e 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -2614,12 +2614,7 @@ package body Exp_Ch4 is
-- Result of the concatenation (of type Ityp)
Actions : constant List_Id := New_List;
- -- Collect actions to be inserted if Save_Space is False
-
- Save_Space : Boolean;
- pragma Warnings (Off, Save_Space);
- -- Set to True if we are saving generated code space by calling routines
- -- in packages System.Concat_n.
+ -- Collect actions to be inserted
Known_Non_Null_Operand_Seen : Boolean;
-- Set True during generation of the assignments of operands into
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 971d0ad65d2..eb23bfd641c 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1461,7 +1461,22 @@ package body Exp_Ch5 is
end if;
if Is_Unchecked_Union (Base_Type (R_Typ)) then
- Insert_Action (N, Make_Field_Assign (CF, True));
+
+ -- Within an initialization procedure this is the
+ -- assignment to an unchecked union component, in which
+ -- case there is no discriminant to initialize.
+
+ if Inside_Init_Proc then
+ null;
+
+ else
+ -- The assignment is part of a conversion from a
+ -- derived unchecked union type with an inferable
+ -- discriminant, to a parent type.
+
+ Insert_Action (N, Make_Field_Assign (CF, True));
+ end if;
+
else
Insert_Action (N, Make_Field_Assign (CF));
end if;
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index dd9f55168a9..2d342c347bc 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -5318,7 +5318,7 @@ This pragma signals that the entities whose names are listed are
deliberately not referenced in the current source unit. This
suppresses warnings about the
entities being unreferenced, and in addition a warning will be
-generated if one of these entities is in fact referenced in the
+generated if one of these entities is in fact subsequently referenced in the
same unit as the pragma (or in the corresponding body, or one
of its subunits).
@@ -10222,7 +10222,7 @@ floating-point standard.
Note that on machines that are not fully compliant with the IEEE
floating-point standard, such as Alpha, the @option{-mieee} compiler flag
-must be used for achieving IEEE confirming behavior (although at the cost
+must be used for achieving IEEE conforming behavior (although at the cost
of a significant performance penalty), so infinite and NaN values are
properly generated.
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 8ef52f0e82c..748a1d247bd 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -5658,8 +5658,8 @@ This switch activates warnings to be generated for entities that
are declared but not referenced, and for units that are @code{with}'ed
and not
referenced. In the case of packages, a warning is also generated if
-no entities in the package are referenced. This means that if the package
-is referenced but the only references are in @code{use}
+no entities in the package are referenced. This means that if a with'ed
+package is referenced but the only references are in @code{use}
clauses or @code{renames}
declarations, a warning is still generated. A warning is also generated
for a generic package that is @code{with}'ed but never instantiated.
diff --git a/gcc/ada/par-labl.adb b/gcc/ada/par-labl.adb
index 8520292ecd2..9bafb07b7d1 100644
--- a/gcc/ada/par-labl.adb
+++ b/gcc/ada/par-labl.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -340,6 +340,7 @@ procedure Labl is
New_Node (N_Loop_Statement, Sloc (Loop_Header));
Stat : Node_Id;
Next_Stat : Node_Id;
+
begin
Stat := Next (Loop_Header);
while Stat /= Loop_End loop
@@ -355,7 +356,7 @@ procedure Labl is
Remove (Loop_Header);
Rewrite (Loop_End, Loop_Stmt);
Error_Msg_N
- ("code between label and backwards goto rewritten as loop?",
+ ("info: code between label and backwards goto rewritten as loop?",
Loop_End);
end Rewrite_As_Loop;