1. 25 Apr, 2017 40 commits
    • [multiple changes] · e7c25229
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_aux.adb (Nearest_Ancestor): Use original node of type
      	declaration to locate nearest ancestor, because derived
      	type declarations for record types are rewritten as record
      	declarations.
      	* sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
      	properly derivations that are completions of private types.
      	(Add_Predicates): If type is private, examine rep. items of full
      	view, which may include inherited predicates.
      	(Build_Predicate_Functions): Ditto.
      
      2017-04-25  Javier Miranda  <miranda@adacore.com>
      
      	* sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
      	to generate new entities for subtype declarations located in
      	Expression_With_Action nodes.
      
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_elab.adb (Check_A_Call): Remove
      	local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
      	need for Elaborate_All when SPARK elaboration checks are
      	required. Update the checks for instances, variables, and calls
      	to Default_Initial_Condition procedures.
      
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
      	into a boolean aspect, in analogy with the Ada aspect No_Return.
      
      From-SVN: r247219
      Arnaud Charlet committed
    • [multiple changes] · a267d8cc
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
      	Is_True_Constant for an array variable that is passed to a
      	foreign function as an 'in' parameter.
      	* debug.adb: Document -gnatd.q.
      
      From-SVN: r247218
      Arnaud Charlet committed
    • sem_ch6.adb (Analyze_Expression_Function): If expression function is completion… · 241f328c
      sem_ch6.adb (Analyze_Expression_Function): If expression function is completion and return type is an access type do not...
      
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch6.adb (Analyze_Expression_Function): If expression function
      	is completion and return type is an access type do not freeze
      	designated type: this will be done in the process of freezing
      	the expression if needed.
      	(Freeze_Expr_Types): Check whether type is complete before
      	creating freeze node, to provide a better error message if
      	reference is premature.
      	* sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
      	functions created by type derivations.
      
      From-SVN: r247217
      Ed Schonberg committed
    • [multiple changes] · cccb761b
      2017-04-25  Pascal Obry  <obry@adacore.com>
      
      	* g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
      
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_res.adb (Resolve_Type_Conversion):
      	When resolving against any fixed type, set the type of the
      	operand as universal real when the operand is a multiplication
      	or a division where both operands are of any fixed type.
      	(Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
      	placement of an error message by pointing to the operand of a
      	type conversion rather than the conversion itself.
      
      2017-04-25  Thomas Quinot  <quinot@adacore.com>
      
      	* sem_ch13.adb (Build_Predicate_Function_Declaration): Set
      	Needs_Debug_Info when producing SCOs.
      
      2017-04-25  Thomas Quinot  <quinot@adacore.com>
      
      	* exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
      	Always pass a null finalization master for a library level named access
      	type to which a pragme No_Heap_Finalization applies.
      
      From-SVN: r247216
      Arnaud Charlet committed
    • dg.exp (find-cxx-tests): New function. · 6a3936d4
      	* g++.dg/dg.exp (find-cxx-tests): New function.
      	(main): Use it, remove explicit pruning
      
      From-SVN: r247215
      Nathan Sidwell committed
    • re PR ada/78845 (Inverse (Real_Matrix) result has wrong bounds) · 9dd958d2
      	PR ada/78845
      
      	* a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
      	set to A'First(2) and vice versa.
      
      From-SVN: r247214
      Arnaud Charlet committed
    • Code clean up. · c16fa01e
      From-SVN: r247213
      Arnaud Charlet committed
    • [multiple changes] · 7738270b
      2017-04-25  Yannick Moy  <moy@adacore.com>
      
      	* freeze.adb (Freeze_Record_Type): Remove obsolete
      	rule on volatile tagged record restriction on SPARK code.
      
      2017-04-25  Yannick Moy  <moy@adacore.com>
      
      	* sem_prag.adb (minor) Fix SPARK RM reference.
      
      2017-04-25  Yannick Moy  <moy@adacore.com>
      
      	* sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
      	comment to reflect which entity is chosen as unique entity.
      	(Unique_Entity): Return full view instead of private spec for
      	protected type or task type. Fix possible incorrect access when
      	called on entry.
      
      2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
      	array types only instead of all packed array types.
      
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch6.adb (Conforming_Types): If type of formal as a specified
      	dimension system, verify that dimensions of both match.
      	(Check_Conformance): Add error message in case of dimension
      	mismatch.
      	* sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
      	predicate.
      
      2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
      
      	* gnatxref.adb, gnatfind.adb: Avoid using the term project file,
      	confusing.
      
      From-SVN: r247212
      Arnaud Charlet committed
    • sem_util.adb: Minor refactoring. · e4b1cd76
      2017-04-25  Yannick Moy  <moy@adacore.com>
      
      	* sem_util.adb: Minor refactoring.
      	* freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
      
      From-SVN: r247211
      Yannick Moy committed
    • Minor reformatting. · 245fee17
      From-SVN: r247210
      Arnaud Charlet committed
    • [multiple changes] · 3e3bc136
      2017-04-25  Claire Dross  <dross@adacore.com>
      
      	* sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
      	ultimate alias when accessing overridden operation. Indeed, if the
      	overridden operation is itself inherited, it won't have any explicit
      	contract.
      
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
      	overlap if the two formals have different types, because formally
      	the corresponding actuals cannot designate the same objects.
      
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
      	dimensions are present from context, use them.	b) If operand is
      	a static constant rewritten as a literal, obtain the dimensions
      	from the original declaration, otherwise use dimensions of type
      	established from context.
      
      2017-04-25  Yannick Moy  <moy@adacore.com>
      
      	* sem_util.adb (Is_Effectively_Volatile): Protect against base type
      	of array that is private.
      
      From-SVN: r247209
      Arnaud Charlet committed
    • re PR tree-optimization/80492 (Wrong code when unrolling a loop with inline asm and local regs) · bed3fd46
      2017-04-25  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/80492
      	* alias.c (compare_base_decls): Handle registers with asm
      	specification conservatively.
      	* tree-ssa-alias.c (decl_refs_may_alias_p): Handle
      	compare_base_decls returning dont-know properly.
      
      	* gcc.dg/pr80492.c: New testcase.
      
      From-SVN: r247208
      Richard Biener committed
    • [multiple changes] · ca0b6141
      2017-04-25  Gary Dismukes  <dismukes@adacore.com>
      
      	* sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
      	reformatting.
      
      2017-04-25  Yannick Moy  <moy@adacore.com>
      
      	* a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
      	on body.
      
      From-SVN: r247207
      Arnaud Charlet committed
    • [multiple changes] · 5f8d3dd5
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_disp.adb (Check_Dispatching_Context): Add guard to refine
      	the check that recognizes a call to a private overridding and
      	replaces the called subprogram with its alias.
      
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_util.adb: Minor reformatting.
      
      From-SVN: r247206
      Arnaud Charlet committed
    • Code cleanups. · 0bcee275
      From-SVN: r247205
      Arnaud Charlet committed
    • [multiple changes] · b554177a
      2017-04-25  Justin Squirek  <squirek@adacore.com>
      
      	* exp_ch3.adb (Freeze_Type): Add condition to always treat
      	interface types as a partial view of a private type for the
      	generation of invariant procedure bodies.
      	* exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
      	Add a condition to get the Corresponding_Record_Type for
      	concurrent types, add condition to return in the absence of a
      	class in the pragma, remove call to Replace_Type_References,
      	and add call to Replace_References.
      	(Add_Interface_Invariatns),
      	(Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
      	to including the working type T.
      	(Add_Own_Invariants): Remove
      	legacy condition for separate units, remove dispatching for ASIS
      	and save a copy of the expression in the pragma expression.
      	(Build_Invariant_Procedure_Body): Default initalize vars,
      	remove return condition on interfaces, always use the
      	private type for interfaces, and move the processing of types
      	until after the processing of invariants for the full view.
      	(Build_Invariant_Procedure_Declaration): Remove condition
      	to return if an interface type is encountered and add
      	condition to convert the formal parameter to its class-wide
      	counterpart if Work_Typ is abstract.
      	(Replace_Type): Add call to Remove_Controlling_Arguments.
      	(Replace_Type_Ref): Remove class-wide dispatching for the current
      	instance of the type.
      	(Replace_Type_References): Remove parameter "Derived"
      	(Remove_Controlling_Arguments): Created in order to removing
      	the controlliong argument from calls to primitives in the case
      	of the formal parameter being an class-wide abstract type.
      	* sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
      	to the change made to Freeze_Type in exp_ch3. Add a condition
      	to treat interface types as a partial view.
      	* sem_prag.adb (Analyze_Pragma): Modify parameters in the call
      	to Build_Invariant_Procedure_Declaration to properly generate a
      	"partial" invariant procedure when Typ is an interface.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* a-numeri.ads: Go back to using brackets encoding for the Greek
      	letter pi.
      
      From-SVN: r247204
      Arnaud Charlet committed
    • Fix broken attr-alloc_size-10.c for avr · c9e9c3ac
      Integer promotion combined with equal sizes for short and int (16 bits)
      causes overflow warnings when expanding the TEST macro for USHRT_MAX.
      
      Fix by explicitly disabling overflow warnings for targets with !int32plus.
      
      gcc/testsuite/
      
      2017-04-25  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
      
      	* gcc.dg/attr-alloc_size-10.c: Ignore overflow warnings
      	for targets with int size less than 32 bits.
      
      From-SVN: r247203
      Senthil Kumar Selvaraj committed
    • [multiple changes] · 904a2ae4
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
      	(10-15): if derived type T with progenitors is abstract,
      	and primitive P of this type inherits non-trivial classwide
      	preconditions from both a parent operation and from an interface
      	operation, then the inherited operation is abstract if the parent
      	operation is not null.
      	* sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
      	with Covered_Interface_Op to yield the actual interface operation
      	that is implemented by a given inherited operation.
      
      2017-04-25  Javier Miranda  <miranda@adacore.com>
      
      	* exp_ch4.adb (Expand_N_Op_Expon): Relocate left
      	and right operands after performing the validity checks. Required
      	because validity checks may remove side effects from the operands.
      
      2017-04-25  Javier Miranda  <miranda@adacore.com>
      
      	* exp_attr.adb (Attribute_Unrestricted_Access):
      	Do not disable implicit type conversion.  Required to generate
      	code that displaces the pointer to reference the secondary
      	dispatch table.
      
      2017-04-25  Pascal Obry  <obry@adacore.com>
      
      	* prj-attr.adb, snames.ads-tmpl: Add package Install's
      	Required_Artifacts attribute.
      
      From-SVN: r247202
      Arnaud Charlet committed
    • [ARC] Addresses can use long immediate for offsets. · ac2e1a51
      gcc/
      2017-04-25  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.c (LEGITIMATE_OFFSET_ADDRESS_P): Delete macro.
      	(legitimate_offset_address_p): New function.
      	(arc_legitimate_address_p): Use above function.
      
      From-SVN: r247201
      Claudiu Zissulescu committed
    • [ARC] Fix calling multiple inheritances. · 1f8876c7
      The TARGET_ASM_OUTPUT_MI_THUNK hook doesn't take into account the
      variant when we compile for PIC.
      
      gcc/
      2017-04-25  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.c (arc_output_mi_thunk): Emit PIC calls.
      
      From-SVN: r247200
      Claudiu Zissulescu committed
    • [ARC] Use ACCL, ACCH registers whenever they are available. · 8b22ef6a
      gcc/
      2017-04-25  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.c (arc_conditional_register_usage): Use ACCL,
      	ACCH registers whenever they are available.
      
      From-SVN: r247199
      Claudiu Zissulescu committed
    • [ARC] Make D0, D1 double regs fix when not used. · ad3d6e77
      gcc/
      2017-04-25  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.c (arc_conditional_register_usage): Make D0, D1
      	double regs fix when not used.
      
      From-SVN: r247198
      Claudiu Zissulescu committed
    • [multiple changes] · 8f34c90b
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_util.adb (Same_Value): String literals are compile-time
      	values, and comparing them must use Expr_Value_S.
      
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch4.adb (Complete_Object_Interpretation): If an explicit
      	dereference is introduced for the object, and the object is
      	overloaded, do not check whether it is aliased, because it may
      	include an implicit dereference.
      	* sem_type.adb (Disambiguate): If two interpretations are access
      	attribute types with the same designated type keep either of
      	them and do not report an ambiguity.  A true ambiguity will be
      	reported elsewhere.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* a-numeri.ads: Change the encoding of Greek letter Pi from
      	brackets encoding to UTF-8.  Use pragma Wide_Character_Encoding
      	to indicate the encoding. We considered using a byte order mark
      	(BOM), but that causes various trouble (misc software eats the
      	BOM, if you have a patch with a BOM, then it's not at the start
      	of the patch, so it's not a BOM, the BOM affects with-ing files,
      	etc.).
      	* scng.adb, s-wchcnv.adb: Minor.
      
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
      
      From-SVN: r247197
      Arnaud Charlet committed
    • [ARC] Allow extension core registers to be used for addresses. · 4f9c5d5c
      gcc/
      2017-04-25  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.h (REGNO_OK_FOR_BASE_P): Consider also extension
      	core registers.
      	(REG_OK_FOR_INDEX_P_NONSTRICT): Likewise.
      	(REG_OK_FOR_BASE_P_NONSTRICT): Likewise.
      
      From-SVN: r247196
      Claudiu Zissulescu committed
    • [ARC] Differentiate between ARCv1 and ARCv2 'h'-reg class for ADD insns. · a0caeef6
      gcc/
      2017-04-25  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.c (arc_output_addsi): Check for h-register class
      	when emitting short ADD instructions.
      
      From-SVN: r247195
      Claudiu Zissulescu committed
    • [ARC] Differentiate between ARCv1 and ARCv2 'h'-reg class for CMP insns. · 0e03cebd
      gcc/
      2017-04-25  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.md (cmpsi_cc_insn_mixed): Use 'h' register
      	constraint.
      	(cmpsi_cc_c_insn): Likewise.
      	(cbranchsi4_scratch): Compute proper instruction length using
      	compact_hreg_operand.
      	* config/arc/predicates.md (compact_hreg_operand): New predicate.
      
      From-SVN: r247194
      Claudiu Zissulescu committed
    • Code clenups. · bac865a2
      From-SVN: r247193
      Arnaud Charlet committed
    • [multiple changes] · 321c24f7
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch3.adb (Add_Internal_Interface_Entities): Move
      	Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
      	Improve error message on operations that inherit non-conforming
      	classwide preconditions from ancestor and progenitor.
      	* sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
      	moved here from sem_ch3.
      	* sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
      	check given in RM 6.1.1 (17) concerning renamings of overriding
      	operations that inherits class-wide preconditions from ancestor
      	or progenitor.
      
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
      	(Build_Adjust_Statements): Code cleanup.
      	(Build_Finalizer): Update the initialization of
      	Exceptions_OK.
      	(Build_Finalize_Statements): Code cleanup.
      	(Build_Initialize_Statements): Code cleanup.
      	(Make_Deep_Array_Body): Update the initialization of
      	Exceptions_OK.
      	(Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
      	(Process_Object_Declaration): Generate a null exception handler only
      	when exceptions are allowed.
      	(Process_Transients_In_Scope): Update the initialization of
      	Exceptions_OK.
      	* exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
      	routine.
      	* sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
      	restrictions when the handler is internally generated and the
      	mode is warnings.
      
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
      	enforce legality rule on classwide preconditions inherited from
      	both an ancestor and a progenitor (RM 6.1.1 (10-13).
      	* sem_disp.adb (Check_Dispatching_Context): A call to an abstract
      	subprogram need not be dispatching if it appears in a precondition
      	for an abstract or null subprogram.
      
      2017-04-25  Gary Dismukes  <dismukes@adacore.com>
      
      	* sem_ch10.adb: Minor typo fix.
      
      From-SVN: r247192
      Arnaud Charlet committed
    • * gcc-interface/Makefile.in: Cleanup VxWorks targets. · 6948bc18
      From-SVN: r247186
      Arnaud Charlet committed
    • Minor reformatting. · cc0b3bac
      From-SVN: r247184
      Arnaud Charlet committed
    • [multiple changes] · 457cee0b
      2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* fname.adb (Is_Internal_File_Name): Arrange for the slices to
      	have a length which is a power of 2.
      	(Is_Predefined_File_Name): Likewise. Adjust comment.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* exp_aggr.adb (Component_Count): Protect the
      	arithmetic from attempting to convert a value >= 2**31 to Int,
      	which would otherwise raise Constraint_Error.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* opt.ads (Locking_Policy): Fix incorrect documentation. The
      	first character of the policy name is not unique.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
      	* s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
      	about this flag not being used. It was already used, and it is
      	now used more.
      
      From-SVN: r247183
      Arnaud Charlet committed
    • [multiple changes] · cf9a473e
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
      	(Ignore_SPARK_Mode_Pragmas): New routine.
      	(Set_Ignore_SPARK_Mode_Pragmas): New routine.
      	(Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
      	* einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
      	related entities.
      	(Ignore_SPARK_Mode_Pragmas): New routine
      	along with pragma Inline.
      	(Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
      	* opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
      	Ignore_SPARK_Mode_Pragmas_In_Instance.
      	* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
      	Save and restore the value of global flag
      	Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
      	of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
      	the corresponding spec or the body must ignore all SPARK_Mode
      	pragmas found within.
      	(Analyze_Subprogram_Declaration): Mark
      	the spec when it needs to ignore all SPARK_Mode pragmas found
      	within to allow the body to infer this property in case it is
      	instantiated or inlined later.
      	* sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
      	value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
      	the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
      	when the corresponding spec also ignored all SPARK_Mode pragmas
      	found within.
      	(Analyze_Package_Declaration): Mark the spec when
      	it needs to ignore all SPARK_Mode pragmas found within to allow
      	the body to infer this property in case it is instantiated or
      	inlined later.
      	* sem_ch12.adb (Analyze_Formal_Package_Declaration):
      	Save and restore the value of flag
      	Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
      	formal spec when it needs to ignore all SPARK_Mode
      	pragmas found within to allow the body to infer this
      	property in case it is instantiated or inlined later.
      	(Analyze_Package_Instantiation): Save and restore the value
      	of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
      	the instance spec when it needs to ignore all SPARK_Mode
      	pragmas found within to allow the body to infer this
      	property in case it is instantiated or inlined later.
      	(Analyze_Subprogram_Instantiation): Save and restore the value
      	of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
      	instance spec and anonymous package when they need to ignore
      	all SPARK_Mode pragmas found within to allow the body to infer
      	this property in case it is instantiated or inlined later.
      	(Instantiate_Package_Body): Save and restore the value of global
      	flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
      	global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
      	corresponding instance spec also ignored all SPARK_Mode pragmas
      	found within.
      	(Instantiate_Subprogram_Body): Save and restore the
      	value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
      	the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
      	when the corresponding instance spec also ignored all SPARK_Mode
      	pragmas found within.
      	* sem_prag.adb (Analyze_Pragma): Update the reference to
      	Ignore_Pragma_SPARK_Mode.
      	* sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
      	all SPARK_Mode pragmas defined within yields mode "off".
      
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* exp_atag.adb (Build_CW_Membership): Add "Suppress =>
      	All_Checks" to avoid generating unnecessary checks.
      	* exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
      	All_Checks".
      	* sem.ads: Fix comment.
      	* expander.ads: Fix comment.
      	* exp_atag.ads: Fix comment: "Index = 0" should be
      	"Index >= 0".
      
      2017-04-25  Gary Dismukes  <dismukes@adacore.com>
      
      	* s-taprop-linux.adb: Minor editorial fixes.
      
      From-SVN: r247182
      Arnaud Charlet committed
    • sem_util.adb (New_Copy_Tree): Put back the declarations of the hash tables at library level. · 1f0bcd44
      2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* sem_util.adb (New_Copy_Tree): Put back the declarations of the
      	hash tables at library level.  Reinstate the NCT_Hash_Tables_Used
      	variable and set it to True whenever the main hash table is
      	populated.  Short- circuit the Assoc function if it is false
      	and add associated guards.
      
      From-SVN: r247181
      Arnaud Charlet committed
    • checks.adb (Insert_Valid_Check): Code cleanup. · 62e45e3e
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* checks.adb (Insert_Valid_Check): Code cleanup.
      	* exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
      	(Expand_Actuals): Generate proper copy-back for a validation
      	variable when it acts as the argument of a type conversion.
      	* sem_util.adb (Is_Validation_Variable_Reference): Augment the
      	predicate to operate on type qualifications.
      
      From-SVN: r247180
      Hristian Kirtchev committed
    • sem_prag.adb, [...]: Minor reformatting. · ec40b86c
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
      	Minor reformatting.
      
      From-SVN: r247179
      Hristian Kirtchev committed
    • sem_prag.adb (No_Return): Give an error if the pragma applies to a body. · ca1f6b29
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* sem_prag.adb (No_Return): Give an error if the pragma applies
      	to a body. Specialize the error for the specless body case,
      	as is done for (e.g.) pragma Convention.
      	* debug.adb: Add switch -gnatd.J to disable the above legality
      	checks. This is mainly for use in our test suite, to avoid
      	rewriting a lot of illegal (but working) code.	It might also
      	be useful to customers. Under this switch, if a pragma No_Return
      	applies to a body, and the procedure raises an exception (as it
      	should), the pragma has no effect. If the procedure does return,
      	execution is erroneous.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* exp_ch6.adb (Expand_Actuals): This is the
      	root of the problem. It took N as an 'in out' parameter, and in
      	some cases, rewrote N, but then set N to Original_Node(N). So
      	the node returned in N had no Parent. The caller continued
      	processing of this orphaned node. In some cases that caused a
      	crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
      	and trips over the Empty Parent). The solution is to make N an
      	'in' parameter.  Instead of rewriting it, return the list of
      	post-call actions, so the caller can do the rewriting later,
      	after N has been fully processed.
      	(Expand_Call_Helper): Move most of Expand_Call here. It has
      	too many premature 'return' statements, and we want to do the
      	rewriting on return.
      	(Insert_Post_Call_Actions): New procedure to insert the post-call
      	actions in the appropriate place. In the problematic case,
      	that involves rewriting N as an Expression_With_Actions.
      	(Expand_Call): Call the new procedures Expand_Call_Helper and
      	Insert_Post_Call_Actions.
      
      From-SVN: r247178
      Bob Duff committed
    • [multiple changes] · 36357cf3
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
      	properly type derived from generic formal types, to handle
      	properly modified version of ACATS 4.1B B611017.
      
      2017-04-25  Javier Miranda  <miranda@adacore.com>
      
      	* exp_unst.adb (Subp_Index): Adding missing
      	support for renamings and functions that return a constrained
      	array type (i.e. functions for which the frontend built a
      	procedure with an extra out parameter).
      
      2017-04-25  Pascal Obry  <obry@adacore.com>
      
      	* s-string.adb: Minor code clean-up.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
      	procedure.
      	* adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
      	function for Non_Blocking_Wait_Process.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* prep.adb (Preprocess): Remove incorrect
      	Assert. Current character can be ASCII.CR.
      
      From-SVN: r247177
      Arnaud Charlet committed
    • [multiple changes] · 48c8c473
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
      	convention Stdcall, which has a number of exceptions. Convention
      	is legal on a component declaration whose type is an anonymous
      	access to subprogram.
      
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_ch4.adb: sem_ch4.adb Various reformattings.
      	(Try_One_Prefix_Interpretation): Use the base type when dealing
      	with a subtype created for purposes of constraining a private
      	type with discriminants.
      
      2017-04-25  Javier Miranda  <miranda@adacore.com>
      
      	* einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
      	* warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
      	dispatching primitives (Restore_Warnings): Restore warning on
      	late dispatching primitives (Save_Warnings): Save warning on late
      	dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
      	to enable/disable this warning.
      	(WA_Warnings): Set warning on late dispatching primitives.
      	* sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
      	that its parent type has a private extension.
      	* sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
      	New subprogram.
      	* usage.adb: Document -gnatw.j and -gnatw.J.
      
      From-SVN: r247176
      Arnaud Charlet committed
    • [multiple changes] · 94295b25
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
      	reformatting.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* binde.adb (Validate): Do not pass dynamic strings
      	to pragma Assert, because older compilers do not support that.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* s-fileio.adb (Close): When a temp file is
      	closed, delete it and clean up its Temp_File_Record immediately,
      	rather than waiting until later.
      	(Temp_File_Record): Add File
      	component, so Close can know which Temp_File_Record corresponds
      	to the file being closed.
      	(Delete): Don't delete temp files,
      	because they are deleted by Close.
      	(Open): Set the File component
      	of Temp_File_Record. This requires moving the creation of the
      	Temp_File_Record to the end, after the AFCB has been created.
      
      From-SVN: r247175
      Arnaud Charlet committed
    • [multiple changes] · b0cd50fd
      2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* checks.adb (Insert_Valid_Check): Do not generate
      	a validity check when inside a generic.
      
      2017-04-25  Yannick Moy  <moy@adacore.com>
      
      	* sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
      
      2017-04-25  Arnaud Charlet  <charlet@adacore.com>
      
      	* snames.ads-tmpl (Snames): More names for detecting predefined
      	potentially blocking subprograms.
      
      2017-04-25  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_prag.adb (Analyze_Pre_Post_Condition): The rules
      	concerning inheritance of class-wide preconditions do not apply
      	to postconditions.
      
      2017-04-25  Bob Duff  <duff@adacore.com>
      
      	* s-ficobl.ads: Minor comment fix.
      
      From-SVN: r247174
      Arnaud Charlet committed