]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2014-07-17 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Jul 2014 06:30:05 +0000 (06:30 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Jul 2014 06:30:05 +0000 (06:30 +0000)
* gnat_rm.texi: Minor comment updates.

2014-07-17  Ed Schonberg  <schonberg@adacore.com>

* sem_util.adb (Make_Explicit_Dereference): If the expression
being dereferenced is a generalized indexing, reset the overloaded
flag on the generalized indexing call, consistent with the
resetting of the flag on the original indexed component.

2014-07-17  Robert Dewar  <dewar@adacore.com>

* gnat_ugn.texi: Document advise not to mix -gnatV? and
optimization.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212723 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 1e18c48fc98d78ef37312f8ff57178c04badee2f..249ab16da7bf01f90b208b7ce3a1a3d05a670023 100644 (file)
@@ -1,3 +1,42 @@
+2014-07-17  Robert Dewar  <dewar@adacore.com>
+
+       * gnat_rm.texi: Minor comment updates.
+
+2014-07-17  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_util.adb (Make_Explicit_Dereference): If the expression
+       being dereferenced is a generalized indexing, reset the overloaded
+       flag on the generalized indexing call, consistent with the
+       resetting of the flag on the original indexed component.
+
+2014-07-17  Robert Dewar  <dewar@adacore.com>
+
+       * gnat_ugn.texi: Document advise not to mix -gnatV? and
+       optimization.
+
+2014-07-17  Robert Dewar  <dewar@adacore.com>
+
+       * checks.adb (Insert_Valid_Check): Don't insist on a name
+       for the prefix when we make calls to Force_Evaluation and
+       Duplicate_Subexpr_No_Checks.
+       * exp_util.adb (Is_Volatile_Reference): Handle all cases properly
+       (Remove_Side_Effects): Handle all volatile references right
+       (Side_Effect_Free): Volatile reference is never side effect free
+       * sinfo.ads (N_Attribute_Reference): Add comments explaining
+       that in the tree, the prefix can be a general expression.
+
+2014-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_ch6.adb (Analyze_Subprogram_Body_Contract,
+       Analyze_Subprogram_Contract): Add comments on SPARK_Mode save/restore.
+       * sem_ch7.adb (Analyze_Package_Body_Contract,
+       Analyze_Package_Contract): Add comments on SPARK_Mode save/restore.
+
+2014-07-17  Robert Dewar  <dewar@adacore.com>
+
+       * exp_ch7.ads, exp_util.ads: Document Insert_Action_After,
+       Store_After_Actions_In_Scope.
+
 2014-07-17  Robert Dewar  <dewar@adacore.com>
 
        * sem_aux.ads: Minor comment addition.
index 50d034f214666dd0a4cbaf6336f2efe5308e6aa6..2705d786a7f47d757791ae489e5c590e3f50017f 100644 (file)
@@ -2437,7 +2437,7 @@ This pragma is now obsolete and, other than generating a warning if warnings
 on obsolescent features are enabled, is completely ignored.
 It used to be required to ensure compatibility with C++, but
 is no longer required for that purpose because GNAT generates
-the same object layout than the G++ compiler by default.
+the same object layout as the G++ compiler by default.
 
 See @ref{Interfacing to C++} for related information.
 
index 72b78133713731c13f0788a737a9605e4d486fb7..d635400eef4211b318b6d7e7c4ac176c4cfc5b7f 100644 (file)
@@ -6079,7 +6079,11 @@ The @option{-gnatVa} may be used to enable additional validity checks,
 which are not required by the RM. These checks are often very
 expensive (which is why the RM does not require them). These checks
 are useful in tracking down uninitialized variables, but they are
-not usually recommended for production builds.
+not usually recommended for production builds, and in particular
+we do not recommend using these extra validity checking options in
+combination with optimization, since this can confuse the optimizer.
+If performance is a consideration, leading to the need to optimize,
+then the validity checking options should not be used.
 
 The other @option{-gnatV^@var{x}^^} switches below allow finer-grained
 control; you can enable whichever validity checks you desire. However,
@@ -6820,7 +6824,8 @@ that assumption is wrong.
 
 The checks subject to suppression include all the checks defined by
 the Ada standard, the additional implementation defined checks
-@code{Alignment_Check}, @code{Atomic_Synchronization}, and
+@code{Alignment_Check}, @code{Atomic_Synchronization},
+@code{Duplicated_Tag_Check}, @code{Predicate_Check}, and
 @code{Validity_Check}, as well as any checks introduced using
 @code{pragma Check_Name}.
 
index 5ae64c5cf5c7a5fb0368b3bc54dcc9fa4907d18f..0639e97259c8e38ef3e48b670ccc4a5d3962ab53 100644 (file)
@@ -1367,6 +1367,17 @@ package body Sem_Util is
       end if;
 
       Set_Is_Overloaded (Expr, False);
+
+      --  The expression will often be a generalized indexing that yields a
+      --  container element that is then dereferenced, in which case the
+      --  generalized indexing call is also non-overloaded.
+
+      if Nkind (Expr) = N_Indexed_Component
+        and then Present (Generalized_Indexing (Expr))
+      then
+         Set_Is_Overloaded (Generalized_Indexing (Expr), False);
+      end if;
+
       Rewrite (Expr,
         Make_Explicit_Dereference (Loc,
           Prefix =>
@@ -11872,8 +11883,11 @@ package body Sem_Util is
                return Is_Variable_Prefix (Prefix (Orig_Node));
 
             when N_Selected_Component =>
-               return Is_Variable_Prefix (Prefix (Orig_Node))
-                 and then Is_Variable (Selector_Name (Orig_Node));
+               return (Is_Variable (Selector_Name (Orig_Node))
+                        and then Is_Variable_Prefix (Prefix (Orig_Node)))
+                 or else
+                   (Nkind (N) = N_Expanded_Name
+                     and then Scope (Entity (N)) = Entity (Prefix (N)));
 
             --  For an explicit dereference, the type of the prefix cannot
             --  be an access to constant or an access to subprogram.