[multiple changes]

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).

From-SVN: r180954
This commit is contained in:
Arnaud Charlet 2011-11-04 15:00:29 +01:00
parent 6ec084f387
commit 4c9fe6c749
13 changed files with 149 additions and 31 deletions

View File

@ -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

View File

@ -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)";

View File

@ -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)";

View File

@ -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)";

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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:

View File

@ -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

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -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;