]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 14 Oct 2013 13:10:22 +0000 (15:10 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 14 Oct 2013 13:10:22 +0000 (15:10 +0200)
2013-10-14  Robert Dewar  <dewar@adacore.com>

* exp_prag.adb, exp_ch11.adb, s-exctab.adb: Minor reformatting.
* usage.adb: Add line for -gnateu switch.

2013-10-14  Vincent Celier  <celier@adacore.com>

* lib-writ.ads: Add comments to indicate that a path name in
D lines may be quoted if the path name includes directories
with spaces.

2013-10-14  Robert Dewar  <dewar@adacore.com>

* debug.adb: Document -gnatd.E.
* gnat1drv.adb (Adjust_Global_Switches): Set Error_To_Warning
if -gnatd.E set.
* opt.ads (Error_To_Warning): New switch.
* osint.adb: Minor reformatting.
* sem_warn.adb (Warn_On_Overlapping_Actuals): Overlap is error
in some cases in Ada 2012 mode (unless Error_To_Warning) is set.
* sem_warn.ads (Warn_On_Overlapping_Actuals): Document error
in Ada 2012 mode.

2013-10-14  Tristan Gingold  <gingold@adacore.com>

* cstand.adb: Add a comment for Standard_Exception_Type.

2013-10-14  Ed Schonberg  <schonberg@adacore.com>

* exp_ch4.adb (Process_Transient_Object): If a transient scope
has already been created, use the corresponding Node_To_Be_Wrapped
as the insertion point for the controlled actions.

From-SVN: r203539

14 files changed:
gcc/ada/ChangeLog
gcc/ada/cstand.adb
gcc/ada/debug.adb
gcc/ada/exp_ch11.adb
gcc/ada/exp_ch4.adb
gcc/ada/exp_prag.adb
gcc/ada/gnat1drv.adb
gcc/ada/lib-writ.ads
gcc/ada/opt.ads
gcc/ada/osint.adb
gcc/ada/s-exctab.adb
gcc/ada/sem_warn.adb
gcc/ada/sem_warn.ads
gcc/ada/usage.adb

index b12ce0a717aaf7e43a8cd449443fe159fce52125..bee6a791a512299ccf542afcefa26248c64e55f4 100644 (file)
@@ -1,3 +1,36 @@
+2013-10-14  Robert Dewar  <dewar@adacore.com>
+
+       * exp_prag.adb, exp_ch11.adb, s-exctab.adb: Minor reformatting.
+       * usage.adb: Add line for -gnateu switch.
+
+2013-10-14  Vincent Celier  <celier@adacore.com>
+
+       * lib-writ.ads: Add comments to indicate that a path name in
+       D lines may be quoted if the path name includes directories
+       with spaces.
+
+2013-10-14  Robert Dewar  <dewar@adacore.com>
+
+       * debug.adb: Document -gnatd.E.
+       * gnat1drv.adb (Adjust_Global_Switches): Set Error_To_Warning
+       if -gnatd.E set.
+       * opt.ads (Error_To_Warning): New switch.
+       * osint.adb: Minor reformatting.
+       * sem_warn.adb (Warn_On_Overlapping_Actuals): Overlap is error
+       in some cases in Ada 2012 mode (unless Error_To_Warning) is set.
+       * sem_warn.ads (Warn_On_Overlapping_Actuals): Document error
+       in Ada 2012 mode.
+
+2013-10-14  Tristan Gingold  <gingold@adacore.com>
+
+       * cstand.adb: Add a comment for Standard_Exception_Type.
+
+2013-10-14  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_ch4.adb (Process_Transient_Object): If a transient scope
+       has already been created, use the corresponding Node_To_Be_Wrapped
+       as the insertion point for the controlled actions.
+
 2013-10-14  Tristan Gingold  <gingold@adacore.com>
 
        * cstand.adb (Create_Standard): Change Import_Code component
index 87555fd8fe774c833b550fe28d5c27da0814ccf5..ed0223880496eb94eddd7abbae461343c4753ee9 100644 (file)
@@ -1448,9 +1448,9 @@ package body CStand is
                                (Type_Definition (Parent (Standard_Duration))));
 
          --  Normally it does not matter that nodes in package Standard are
-         --  not marked as analyzed. The Scalar_Range of the fixed-point
-         --  type Standard_Duration is an exception, because of the special
-         --  test made in Freeze.Freeze_Fixed_Point_Type.
+         --  not marked as analyzed. The Scalar_Range of the fixed-point type
+         --  Standard_Duration is an exception, because of the special test
+         --  made in Freeze.Freeze_Fixed_Point_Type.
 
          Set_Analyzed (Scalar_Range (Standard_Duration));
 
@@ -1471,6 +1471,10 @@ package body CStand is
 
       --  Build standard exception type. Note that the type name here is
       --  actually used in the generated code, so it must be set correctly.
+      --  The type Standard_Exception_Type must be consistent with the type
+      --  System.Standard_Library.Exception_Data, as the latter is what is
+      --  known by the run-time. Components of the record are documented in
+      --  the declaration in System.Standard_Library.
 
       Standard_Exception_Type := New_Standard_Entity;
       Set_Ekind       (Standard_Exception_Type, E_Record_Type);
index 5364574421b7168c702a2966512da04d32b6257e..3712fe1ce7d257374bf067bbb0d069e268bcac5c 100644 (file)
@@ -122,7 +122,7 @@ package body Debug is
    --  d.B
    --  d.C  Generate concatenation call, do not generate inline code
    --  d.D  SPARK strict mode
-   --  d.E
+   --  d.E  Turn selected errors into warnings
    --  d.F  SPARK mode
    --  d.G  Frame condition mode for gnat2why
    --  d.H
@@ -581,22 +581,26 @@ package body Debug is
    --  d.w  This flag turns off the scanning of loops to detect possible
    --       infinite loops.
 
-   --  d.A  There seems to be a problem with ASIS if we activate the circuit
-   --       for reading and writing the aspect specification hash table, so
-   --       for now, this is controlled by the debug flag d.A. The hash table
-   --       is only written and read if this flag is set.
-
    --  d.x  No exception handlers in generated code. This causes exception
    --       handlers to be eliminated from the generated code. They are still
    --       fully compiled and analyzed, they just get eliminated from the
    --       code generation step.
 
+   --  d.A  There seems to be a problem with ASIS if we activate the circuit
+   --       for reading and writing the aspect specification hash table, so
+   --       for now, this is controlled by the debug flag d.A. The hash table
+   --       is only written and read if this flag is set.
+
    --  d.C  Generate call to System.Concat_n.Str_Concat_n routines in cases
    --       where we would normally generate inline concatenation code.
 
    --  d.D  SPARK strict mode. Interpret compiler permissions as strictly as
    --       possible in SPARK mode.
-   --
+
+   --  d.E  Turn selected errors into warnings. This debug switch causes a
+   --       specific set of error messages into warnings. Setting this switch
+   --       causes Opt.Error_To_Warning to be set to True.
+
    --  d.F  SPARK mode. Generate AST in a form suitable for formal
    --       verification, as well as additional cross reference information in
    --       ALI files to compute effects of subprograms. Note that ALI files
index d67a67ff8c265e433b25d0ef9c0704be05c73164..1f5ebe8847e724e2b55e2f5ecd8df2bf71bd2301 100644 (file)
@@ -1166,18 +1166,17 @@ package body Exp_Ch11 is
 
    --  Generates:
    --     exceptE : constant String := "A.B.EXCEP";   -- static data
-   --     except : exception_data :=  (
-   --                    Handled_By_Other => False,
-   --                    Lang             => 'A',
-   --                    Name_Length      => exceptE'Length,
-   --                    Full_Name        => exceptE'Address,
-   --                    HTable_Ptr       => null,
-   --                    Foreign_Data     => null,
-   --                    Raise_Hook       => null,
-   --                    );
+   --     except : exception_data :=
+   --                (Handled_By_Other => False,
+   --                 Lang             => 'A',
+   --                 Name_Length      => exceptE'Length,
+   --                 Full_Name        => exceptE'Address,
+   --                 HTable_Ptr       => null,
+   --                 Foreign_Data     => null,
+   --                 Raise_Hook       => null);
 
    --  (protecting test only needed if not at library level)
-   --
+
    --     exceptF : Boolean := True --  static data
    --     if exceptF then
    --        exceptF := False;
index 8d6dfc4da0820abe0c9b885bb67b1ed9202002c9..163363e39118d00ce77431f77e369769503434ff 100644 (file)
@@ -12159,11 +12159,22 @@ package body Exp_Ch4 is
          Top : Node_Id;
 
       begin
+         --  In most cases an expression that creates a controlled object
+         --  generates a transient scope around it. If this is the case then
+         --  other controlled values can reuse it.
+
+         if Scope_Is_Transient then
+            return Node_To_Be_Wrapped;
+
+         --  In some cases, such as return statements, no transient scope is
+         --  generated, in which case we have to look up in the tree to find
+         --  the proper list on which to place the transient.
+
          --  When the node is inside a case/if expression, the lifetime of any
          --  temporary controlled object is extended. Find a suitable insertion
          --  node by locating the topmost case or if expressions.
 
-         if Within_Case_Or_If_Expression (N) then
+         elsif Within_Case_Or_If_Expression (N) then
             Par := N;
             Top := N;
             while Present (Par) loop
index 6f425d15cc4c48fa99a99455b80de1561802d41f..105f024744a67fee723b12b56429eb69db963c09 100644 (file)
@@ -713,7 +713,7 @@ package body Exp_Prag is
                   else
                      Code :=
                         Make_Function_Call (Loc,
-                          Name =>
+                          Name                   =>
                             New_Reference_To (RTE (RE_Import_Address), Loc),
                           Parameter_Associations => New_List
                             (Make_String_Literal (Loc,
index b0e3087508fde5cab14ff406ddc46ea0a9787a5e..24341acd991e3c2eda6d1dd164261ebe9124ac8c 100644 (file)
@@ -117,6 +117,13 @@ procedure Gnat1drv is
          Relaxed_RM_Semantics := True;
       end if;
 
+      --  -gnatd.E sets Error_To_Warning mode, causing selected error messages
+      --  to be treated as warnings instead of errors.
+
+      if Debug_Flag_Dot_EE then
+         Error_To_Warning := True;
+      end if;
+
       --  Disable CodePeer_Mode in Check_Syntax, since we need front-end
       --  expansion.
 
index ef57dfc8252d5888c7a85de2bb9ecb5d71fff84e..f886b668ce0167806d2c4567d90611fa9e36db11 100644 (file)
@@ -777,6 +777,13 @@ package Lib.Writ is
 
    --    D source-name time-stamp checksum [subunit-name] line:file-name
 
+   --      source-name also includes preprocessing data file and preprocessing
+   --      definition file. These preprocessing files may be given as full
+   --      path names instead of simple file names. If a full path name
+   --      includes a directory with spaces, the path name is quoted (quote
+   --      characters (") added at start and end, and any internal quotes are
+   --      doubled).
+
    --      The time-stamp field contains the time stamp of the corresponding
    --      source file. See types.ads for details on time stamp representation.
 
index 492d5bc5829cf6d0f5f4eeee5d4b73220013762b..762ba3959b48367cdb2ba088f07635e862e8e920 100644 (file)
@@ -516,6 +516,13 @@ package Opt is
    --  to make a single long message, and then this message is split up into
    --  multiple lines not exceeding the specified length. Set by -gnatj=nn.
 
+   Error_To_Warning : Boolean := False;
+   --  GNAT
+   --  If True, then certain error messages (e.g. parameter overlap messages
+   --  for procedure calls in Ada 2012 mode) are treated as warnings instead
+   --  of errors. Set by debug flag -gnatd.E. A search for Error_To_Warning
+   --  will identify affected messages.
+
    Exception_Handler_Encountered : Boolean := False;
    --  GNAT
    --  This flag is set true if the parser encounters an exception handler.
index 8765b4cb60e10df6427421e9ce3913f42f663545..aefffc3ed590b8ee1026cd2f06188ae31625247c 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2012, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2013, 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- --
@@ -1044,8 +1044,8 @@ package body Osint is
 
    procedure Fail (S : String) is
    begin
-      --  We use Output in case there is a special output set up.
-      --  In this case Set_Standard_Error will have no immediate effect.
+      --  We use Output in case there is a special output set up. In this case
+      --  Set_Standard_Error will have no immediate effect.
 
       Set_Standard_Error;
       Osint.Write_Program_Name;
index 42d4e952c11baf2b062a9df08c4698c90391bbac..afd46e96f7d0c2c0afd185dc8e31ba4d1efdd9c5 100644 (file)
@@ -67,15 +67,12 @@ package body System.Exception_Table is
       S1 : constant Big_String_Ptr := To_Ptr (A);
       S2 : constant Big_String_Ptr := To_Ptr (B);
       J : Integer := 1;
-
    begin
       loop
          if S1 (J) /= S2 (J) then
             return False;
-
          elsif S1 (J) = ASCII.NUL then
             return True;
-
          else
             J := J + 1;
          end if;
index 8315e65f00aa490552ec4f27a7e74b353b3b6764..d9c80de85108cd028eb6c159cfbc2e7cc4ca2c2b 100644 (file)
@@ -3410,12 +3410,26 @@ package body Sem_Warn is
                   then
                      null;
 
-                  --  Here we may need to issue message
+                  --  Here we may need to issue overlap message
 
                   else
                      Error_Msg_Warn :=
+
+                       --  Overlap checking is an error only in Ada 2012. For
+                       --  earlier versions of Ada, this is a warning.
+
                        Ada_Version < Ada_2012
-                         or else not Is_Elementary_Type (Etype (Form1));
+
+                       --  Overlap is only illegal in Ada 2012 in the case of
+                       --  elementary types (passed by copy). For other types,
+                       --  we always have a warning in all Ada versions.
+
+                       or else not Is_Elementary_Type (Etype (Form1))
+
+                       --  Finally, debug flag -gnatd.E changes the error to a
+                       --  warning even in Ada 2012 mode.
+
+                       or else Error_To_Warning;
 
                      declare
                         Act  : Node_Id;
@@ -3457,23 +3471,28 @@ package body Sem_Warn is
                         then
                            if Act1 = First_Actual (N) then
                               Error_Msg_FE
-                                ("`IN OUT` prefix overlaps with "
-                                 & "actual for&?I?", Act1, Form);
+                                ("<`IN OUT` prefix overlaps with "
+                                 & "actual for&", Act1, Form);
 
                            else
                               --  For greater clarity, give name of formal
 
                               Error_Msg_Node_2 := Form;
                               Error_Msg_FE
-                                ("writable actual for & overlaps with "
-                                  & "actual for&?I?", Act1, Form);
+                                ("<writable actual for & overlaps with "
+                                 & "actual for&", Act1, Form);
                            end if;
 
                         else
+                           --  For greater clarity, give name of formal
+
                            Error_Msg_Node_2 := Form;
+
+                           --  This is one of the messages
+
                            Error_Msg_FE
-                             ("writable actual for & overlaps with "
-                               & "actual for&?I?", Act1, Form1);
+                             ("<writable actual for & overlaps with "
+                              & "actual for&", Act1, Form1);
                         end if;
                      end;
                   end if;
index 0a8839512bb60d719f60f40a74f083707b49a717..22a3c6c42eff0a7296ab6d17f8762cbddf63b9c2 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1999-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 1999-2013, 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- --
@@ -198,7 +198,9 @@ package Sem_Warn is
    procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id);
    --  Called on a subprogram call. Checks whether an IN OUT actual that is
    --  not by-copy may overlap with another actual, thus leading to aliasing
-   --  in the body of the called subprogram.
+   --  in the body of the called subprogram. This is indeed a warning in Ada
+   --  versions prior to Ada 2012, but, unless Opt.Error_To_Warning is set by
+   --  use of debug flag -gnatd.E, this is illegal and generates an error.
 
    procedure Warn_On_Suspicious_Index (Name : Entity_Id; X : Node_Id);
    --  This is called after resolving an indexed component or a slice. Name
index ffcd7246905b2a0924973ee94b191161e40a76ce..2d541c4ae6642a08de2ec1e4206b53f2eb6f4675 100644 (file)
@@ -251,6 +251,11 @@ begin
    Write_Switch_Char ("eT=?");
    Write_Line ("Read target dependent information file ?, e.g. gnateT=tdf");
 
+   --  Line for -gnateu switch
+
+   Write_Switch_Char ("eu");
+   Write_Line ("Ignore unrecognized style/validity/warning switches");
+
    --  Line for -gnateV switch
 
    Write_Switch_Char ("eV");