[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 25 Apr 2013 10:46:18 +0000 (12:46 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 25 Apr 2013 10:46:18 +0000 (12:46 +0200)
2013-04-25  Robert Dewar  <dewar@adacore.com>

* sem_util.adb: Minor reformatting.

2013-04-25  Ed Schonberg  <schonberg@adacore.com>

* exp_aggr.adb (Expand_N_Aggregate): Use special circuitry to
fold strings with a single others choice only if there are no
expressions in the aggregate.

2013-04-25  Arnaud Charlet  <charlet@adacore.com>

* gnat_ugn.texi: Update doc on Ada 2012 default mode.

From-SVN: r198293

gcc/ada/ChangeLog
gcc/ada/exp_aggr.adb
gcc/ada/gnat_ugn.texi
gcc/ada/sem_util.adb

index 1071a704da3636b227d81f655fabb6688089a840..3ce146979fe99162215943b979a06d6b0676f12e 100644 (file)
@@ -1,3 +1,17 @@
+2013-04-25  Robert Dewar  <dewar@adacore.com>
+
+       * sem_util.adb: Minor reformatting.
+
+2013-04-25  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_aggr.adb (Expand_N_Aggregate): Use special circuitry to
+       fold strings with a single others choice only if there are no
+       expressions in the aggregate.
+
+2013-04-25  Arnaud Charlet  <charlet@adacore.com>
+
+       * gnat_ugn.texi: Update doc on Ada 2012 default mode.
+
 2013-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * exp_ch6.adb: Add with and use clause for Stringt.
index c4a80ef8406872f23a781ebbaca3f83e799df842..e0a91324a8069e5e7637c65c9a8943d4e02668fe 100644 (file)
@@ -5226,9 +5226,10 @@ package body Exp_Aggr is
       else
          --  A special case, if we have a string subtype with bounds 1 .. N,
          --  where N is known at compile time, and the aggregate is of the
-         --  form (others => 'x'), and N is less than 80 (an arbitrary limit
-         --  for now), then replace the aggregate by the equivalent string
-         --  literal (but do not mark it as static since it is not!)
+         --  form (others => 'x'), with a single choice and no expressions,
+         --  and N is less than 80 (an arbitrary limit for now), then replace
+         --  the aggregate by the equivalent string literal (but do not mark
+         --  it as static since it is not!)
 
          --  Note: this entire circuit is redundant with respect to code in
          --  Expand_Array_Aggregate that collapses others choices to positional
@@ -5262,6 +5263,7 @@ package body Exp_Aggr is
             begin
                if Nkind (First (Choices (CA))) = N_Others_Choice
                  and then Nkind (Expression (CA)) = N_Character_Literal
+                 and then No (Expressions (N))
                then
                   declare
                      T  : constant Entity_Id := Etype (N);
index 83608c62ca8e5a19d954d5a23442e28297048ffe..af5209c5f8b35dbe89dc017c2d58cf495b4714af 100644 (file)
@@ -89,8 +89,6 @@ Texts.  A copy of the license is included in the section entitled
 
 @set FSFEDITION
 @set EDITION GNAT
-@set DEFAULTLANGUAGEVERSION Ada 2005
-@set NONDEFAULTLANGUAGEVERSION Ada 95
 
 @ifset unw
 @set PLATFORM
@@ -237,15 +235,13 @@ toolset for the full Ada programming language.
 It documents the features of the compiler and tools, and explains
 how to use them to build Ada applications.
 
-@value{EDITION} implements Ada 95 and Ada 2005, and it may also be invoked in
-Ada 83 compatibility mode.
-By default, @value{EDITION} assumes @value{DEFAULTLANGUAGEVERSION},
-but you can override with a compiler switch
-(@pxref{Compiling Different Versions of Ada})
+@value{EDITION} implements Ada 95, Ada 2005 and Ada 2012, and it may also be
+invoked in Ada 83 compatibility mode.
+By default, @value{EDITION} assumes Ada 2012, but you can override with a
+compiler switch (@pxref{Compiling Different Versions of Ada})
 to explicitly specify the language version.
 Throughout this manual, references to ``Ada'' without a year suffix
-apply to both the Ada 95 and Ada 2005 versions of the language.
-
+apply to both all Ada 95/2005/2012 versions of the language.
 
 @ifclear FSFEDITION
 For ease of exposition, ``@value{EDITION}'' will be referred to simply as
@@ -253,8 +249,6 @@ For ease of exposition, ``@value{EDITION}'' will be referred to simply as
 @end ifclear
 
 
-
-
 @menu
 * What This Guide Contains::
 * What You Should Know before Reading This Guide::
@@ -6762,8 +6756,8 @@ and specifications where a separate body is present).
 @noindent
 The switches described in this section allow you to explicitly specify
 the version of the Ada language that your programs are written in.
-By default @value{EDITION} assumes @value{DEFAULTLANGUAGEVERSION},
-but you can also specify @value{NONDEFAULTLANGUAGEVERSION} or
+The default mode is Ada 2012,
+but you can also specify Ada 95, Ada 2005 mode, or
 indicate Ada 83 compatibility mode.
 
 @table @option
@@ -6831,13 +6825,6 @@ may generally be compiled using this switch (see the description of the
 @option{-gnat83} and @option{-gnat95} switches for further
 information).
 
-@ifset PROEDITION
-Note that even though Ada 2005 is the current official version of the
-language, GNAT still compiles in Ada 95 mode by default, so if you are
-using Ada 2005 features in your program, you must use this switch (or
-the equivalent Ada_05 or Ada_2005 configuration pragmas).
-@end ifset
-
 @item -gnat12 or -gnat2012 (Ada 2012 mode)
 @cindex @option{-gnat12} (@command{gcc})
 @cindex @option{-gnat2012} (@command{gcc})
@@ -6845,7 +6832,7 @@ the equivalent Ada_05 or Ada_2005 configuration pragmas).
 
 @noindent
 This switch directs the compiler to implement the Ada 2012 version of the
-language.
+language (also the default).
 Since Ada 2012 is almost completely upwards
 compatible with Ada 2005 (and thus also with Ada 83, and Ada 95),
 Ada 83 and Ada 95 programs
@@ -6853,11 +6840,6 @@ may generally be compiled using this switch (see the description of the
 @option{-gnat83}, @option{-gnat95}, and @option{-gnat05/2005} switches
 for further information).
 
-For information about the approved ``Ada Issues'' that have been incorporated
-into Ada 2012, see @url{http://www.ada-auth.org/ais.html}.
-Included with GNAT releases is a file @file{features-ada12} that describes
-the set of implemented Ada 2012 features.
-
 @item -gnatX (Enable GNAT Extensions)
 @cindex @option{-gnatX} (@command{gcc})
 @cindex Ada language extensions
index 653a6ba0a267598b74a62ffc318091eff423cb0c..ab68c39f9912d2bb5f392e1147c46aea010da9c1 100644 (file)
@@ -8891,10 +8891,10 @@ package body Sem_Util is
    begin
       Note_Possible_Modification (AV, Sure => True);
 
-      --  We must reject parenthesized variable names. The check for
-      --  Comes_From_Source is present because there are currently
-      --  cases where the compiler violates this rule (e.g. passing
-      --  a task object to its controlled Initialize routine).
+      --  We must reject parenthesized variable names. Comes_From_Source is
+      --  checked because there are currently cases where the compiler violates
+      --  this rule (e.g. passing a task object to its controlled Initialize
+      --  routine). This should be properly documented in sinfo???
 
       if Paren_Count (AV) > 0 and then Comes_From_Source (AV) then
          return False;
@@ -8907,15 +8907,13 @@ package body Sem_Util is
       --  Unchecked conversions are allowed only if they come from the
       --  generated code, which sometimes uses unchecked conversions for out
       --  parameters in cases where code generation is unaffected. We tell
-      --  source unchecked conversions by seeing if they are rewrites of an
-      --  original Unchecked_Conversion function call, or of an explicit
+      --  source unchecked conversions by seeing if they are rewrites of
+      --  an original Unchecked_Conversion function call, or of an explicit
       --  conversion of a function call or an aggregate (as may happen in the
       --  expansion of a packed array aggregate).
 
       elsif Nkind (AV) = N_Unchecked_Type_Conversion then
-         if Nkind_In (Original_Node (AV),
-                        N_Function_Call, N_Aggregate)
-         then
+         if Nkind_In (Original_Node (AV), N_Function_Call, N_Aggregate) then
             return False;
 
          elsif Comes_From_Source (AV)