aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-17 08:30:05 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-17 08:30:05 +0200
commit26d5fb62eff87da5ee2ff5bf2f7129d2a842f8c6 (patch)
tree800e26eda8888c1d85b11cebeb89151b3e49be65 /gcc
parentc61ef4169e502c5b67306f3b32cf463e55309d6e (diff)
downloadgcc-26d5fb62eff87da5ee2ff5bf2f7129d2a842f8c6.zip
gcc-26d5fb62eff87da5ee2ff5bf2f7129d2a842f8c6.tar.gz
gcc-26d5fb62eff87da5ee2ff5bf2f7129d2a842f8c6.tar.bz2
[multiple changes]
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. From-SVN: r212723
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog39
-rw-r--r--gcc/ada/gnat_rm.texi2
-rw-r--r--gcc/ada/gnat_ugn.texi9
-rw-r--r--gcc/ada/sem_util.adb18
4 files changed, 63 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1e18c48..249ab16 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,44 @@
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.
2014-07-17 Ed Schonberg <schonberg@adacore.com>
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 50d034f..2705d78 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -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.
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 72b7813..d635400 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -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}.
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 5ae64c5..0639e97 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -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.