From: charlet Date: Thu, 17 Jul 2014 06:30:05 +0000 (+0000) Subject: 2014-07-17 Robert Dewar X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b99dce13fa6c9755644f49e625a8f2ad6fa0c7e;p=thirdparty%2Fgcc.git 2014-07-17 Robert Dewar * gnat_rm.texi: Minor comment updates. 2014-07-17 Ed Schonberg * 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 * 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1e18c48fc98d..249ab16da7bf 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,42 @@ +2014-07-17 Robert Dewar + + * gnat_rm.texi: Minor comment updates. + +2014-07-17 Ed Schonberg + + * 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 + + * gnat_ugn.texi: Document advise not to mix -gnatV? and + optimization. + +2014-07-17 Robert Dewar + + * 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 + + * 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 + + * exp_ch7.ads, exp_util.ads: Document Insert_Action_After, + Store_After_Actions_In_Scope. + 2014-07-17 Robert Dewar * sem_aux.ads: Minor comment addition. diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 50d034f21466..2705d786a7f4 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 72b781337137..d635400eef42 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 5ae64c5cf5c7..0639e97259c8 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.