From 9dc30a5f18d3827d10f118b1758e8453f7aca994 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 16 Jul 2014 16:51:47 +0200 Subject: [PATCH] [multiple changes] 2014-07-16 Vincent Celier * gnatls.adb: Get the target parameters only if -nostdinc was not specified. 2014-07-16 Ed Schonberg * checks.adb (Insert_Valid_Check): If the expression is a packed component of a modular type of the right size the data is always valid. This os particularly useful if the component is part of a volatile variable. 2014-07-16 Robert Dewar * gnat_rm.texi, sinfo.ads, freeze.adb, exp_aggr.adb: Minor reformatting 2014-07-16 Thomas Quinot * exp_ch7.ads: Minor documentation fix. From-SVN: r212663 --- gcc/ada/ChangeLog | 20 ++++++++++++++++++++ gcc/ada/checks.adb | 11 +++++++++++ gcc/ada/exp_aggr.adb | 3 +-- gcc/ada/exp_ch7.ads | 6 +++--- gcc/ada/freeze.adb | 1 + gcc/ada/gnat_rm.texi | 6 +++--- gcc/ada/gnatls.adb | 10 ++++++++-- gcc/ada/sinfo.ads | 16 +++++++++++++--- 8 files changed, 60 insertions(+), 13 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c073f87..778550e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,23 @@ +2014-07-16 Vincent Celier + + * gnatls.adb: Get the target parameters only if -nostdinc was + not specified. + +2014-07-16 Ed Schonberg + + * checks.adb (Insert_Valid_Check): If the expression is a packed + component of a modular type of the right size the data is always + valid. This os particularly useful if the component is part of + a volatile variable. + +2014-07-16 Robert Dewar + + * gnat_rm.texi, sinfo.ads, freeze.adb, exp_aggr.adb: Minor reformatting + +2014-07-16 Thomas Quinot + + * exp_ch7.ads: Minor documentation fix. + 2014-07-16 Ed Schonberg * sem_ch3.adb (Find_Type_Name): Diagnose properly diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 87777de..ea1f164 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6444,6 +6444,17 @@ package body Checks is return; end if; + -- If the expression is a packed component of a modular type of the + -- right size, the data is always valid. + + if Nkind (Expr) = N_Selected_Component + and then Present (Component_Clause (Entity (Selector_Name (Expr)))) + and then Is_Modular_Integer_Type (Typ) + and then Modulus (Typ) = 2 ** Esize (Entity (Selector_Name (Expr))) + then + return; + end if; + -- If we have a checked conversion, then validity check applies to -- the expression inside the conversion, not the result, since if -- the expression inside is valid, then so is the conversion result. diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 377fc7b..44edd88 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -3049,8 +3049,7 @@ package body Exp_Aggr is end loop; if not Is_Empty_List (Init_Actions) then - Comp_Stmt := Make_Compound_Statement (Loc, - Actions => Init_Actions); + Comp_Stmt := Make_Compound_Statement (Loc, Actions => Init_Actions); Insert_Action_After (Init_Node, Comp_Stmt); Set_Initialization_Statements (Obj, Comp_Stmt); end if; diff --git a/gcc/ada/exp_ch7.ads b/gcc/ada/exp_ch7.ads index 2cb4265..6055ce0 100644 --- a/gcc/ada/exp_ch7.ads +++ b/gcc/ada/exp_ch7.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -298,8 +298,8 @@ package Exp_Ch7 is -- the top of the scope stack. procedure Store_After_Actions_In_Scope (L : List_Id); - -- Append the list L of actions to the beginning of the after-actions store - -- in the top of the scope stack. + -- Prepend the list L of actions to the beginning of the after-actions + -- store in the top of the scope stack. procedure Wrap_Transient_Declaration (N : Node_Id); -- N is an object declaration. Expand the finalization calls after the diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 95ea1eb..45175d7 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -1372,6 +1372,7 @@ package body Freeze is procedure Explode_Initialization_Compound_Statement (E : Entity_Id) is Init_Stmts : constant Node_Id := Initialization_Statements (E); + begin if Present (Init_Stmts) and then Nkind (Init_Stmts) = N_Compound_Statement diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 70b4c25..50d034f 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -19572,9 +19572,9 @@ Henry Spencer (and binary compatible with this C library). @noindent A unit to rewrite on-the-fly string occurrences in a stream of -data. The implementation has a very minimum memory footprint as the -full content to be processed is not loaded into memory. This makes -this implementation usable for large files or socket streams. +data. The implementation has a very minimal memory footprint as the +full content to be processed is not loaded into memory all at once. This makes +this interface usable for large files or socket streams. @node GNAT.Secondary_Stack_Info (g-sestin.ads) @section @code{GNAT.Secondary_Stack_Info} (@file{g-sestin.ads}) diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb index aa36e33..33f7682 100644 --- a/gcc/ada/gnatls.adb +++ b/gcc/ada/gnatls.adb @@ -1622,10 +1622,16 @@ begin First_Lib_Dir := First_Lib_Dir.Next; end loop; - -- Finally, add the default directories and obtain target parameters + -- Finally, add the default directories Osint.Add_Default_Search_Dirs; - Get_Target_Parameters; + + -- Get the target parameters to know if the target is OpenVMS, but only if + -- switch -nostdinc was not specified. + + if not Opt.No_Stdinc then + Get_Target_Parameters; + end if; if Verbose_Mode then Write_Eol; diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index e879edd..3bae44d 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -81,7 +81,7 @@ package Sinfo is -- the utility program which creates the Treeprs spec (in file treeprs.ads) -- must be updated appropriately, since it special cases expression fields. - -- If a new tree node is added, then the following changes are made + -- If a new tree node is added, then the following changes are made: -- Add it to the documentation in the appropriate place -- Add its fields to this documentation section @@ -487,6 +487,16 @@ package Sinfo is -- they are set to Empty. This needs sorting out ??? It would be much -- cleaner if they could always be set in the original node ??? + -- There are a few cases when ASIS has to use not the original, but the + -- rewritten tree structures. This happens when because of some important + -- technical reasons it is impossible or very hard to have the original + -- structure properly decorated by semantic information, and the rewritten + -- structure fully reproduces the original source. Below is the (incomplete + -- for the moment) list of such exceptions: + -- + -- * generic specifications and generic bodies; + -- * function calls that use prefixed notation (Operand.Operation [(...)]); + -- Representation Information -- For the purposes of the data description annex, the representation @@ -7323,8 +7333,8 @@ package Sinfo is -- entire list of actions to be moved around as a whole) appearing -- in a sequence of statements. - -- This is the statement counterpart to expression node N_Expression_ - -- With_Actions. + -- This is the statement counterpart to the expression node + -- N_Expression_With_Actions. -- The required semantics is that the set of actions is executed in -- the order in which it appears, as though they appeared by themselves -- 2.7.4