* 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
+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.
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.
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,
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}.
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 =>
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.