]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 4 Nov 2011 14:00:29 +0000 (15:00 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 4 Nov 2011 14:00:29 +0000 (15:00 +0100)
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

13 files changed:
gcc/ada/ChangeLog
gcc/ada/a-cbdlli.adb
gcc/ada/a-cdlili.adb
gcc/ada/a-cidlli.adb
gcc/ada/a-cobove.adb
gcc/ada/a-coinve.adb
gcc/ada/a-convec.adb
gcc/ada/exp_attr.adb
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch5.adb
gcc/ada/gnat_rm.texi
gcc/ada/gnat_ugn.texi
gcc/ada/par-labl.adb

index be2dceaf7942a63fd960532ff224ae141538d7dd..7924c40afed65b4c8e4781c0c24872a4e3ae11b3 100644 (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
index 1b10d42b4a36ccce921d599463d9832e7c33ae81..e1f7725d5cdf2dcf74ddd3bbddcfd4ab0b5f3dc1 100644 (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)";
index 326c74b0785a457494692e2da8eb09f2e75b78bd..8b513222ef81c7ed62a0bd7b8f01323072507e4d 100644 (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)";
index 42bd3c48313fcfc3d78595fba5d2ea424d1483c8..dbdc6de47d473457456504e54c7c6f72c07a0d7e 100644 (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)";
index 16d465d5f0ec48492f8d69e4cb3f264f4a52db06..e78e3ce12d37d5333e38cbb390b2a210312ff172 100644 (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;
 
index ae72e65ed51dba13d3d86d6d5efb25dee6508b07..e35f2f781de99e6b152bfe1d37a14c7842f6cfef 100644 (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;
 
index b18de68a7370f4becd8cf9ca0b846c8446a4161e..79071810182a6e0d3ae71cf2e499a1546d3e880b 100644 (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;
 
index db8f6a30d5d88e515e6957163a9a5f13e5f37b32..57e94d29840010e2471960e113e877897008b274 100644 (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:
index 8f2b86543dbd1c90ee4cd9394a7d29de5222b42d..d2f0668873e48ee4fe9975c621ee8a60c70b619b 100644 (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
index 971d0ad65d2e65dadf8f7768233d19dacf5b96c3..eb23bfd641cc3bc2454cb2f56edd77b2e5392f13 100644 (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;
index dd9f55168a97ea6a265ab299ad4d7185aafdc0c1..2d342c347bc775273a58f39270229fb95d39727c 100644 (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.
 
index 8ef52f0e82c8ad632dfc479bf46d6dbd981c9613..748a1d247bde89e63af753bd95225b7f8ad0fddc 100644 (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.
index 8520292ecd2612744d71998b6c3c756b7fd5796b..9bafb07b7d190777e18d9d06e149d5cf97c90bc2 100644 (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;