Commit Graph

138768 Commits

Author SHA1 Message Date
Hristian Kirtchev
241ebe892a exp_ch3.adb (Expand_N_Full_Type_Declaration): Capture, set and restore the Ghost mode.
2015-05-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch3.adb (Expand_N_Full_Type_Declaration): Capture, set and
	restore the Ghost mode.
	(Expand_N_Object_Declaration): Capture, set and restore the Ghost mode.
	(Freeze_Type): Update the call to Set_Ghost_Mode.
	(Restore_Globals): New routine.
	* exp_ch5.adb Add with and use clauses for Ghost.
	(Expand_N_Assignment_Statement): Capture, set and restore the
	Ghost mode.
	(Restore_Globals): New routine.
	* exp_ch6.adb Add with and use clauses for Ghost.
	(Expand_N_Procedure_Call_Statement): Capture, set and
	restore the Ghost mode.
	(Expand_N_Subprogram_Body):
	Code cleanup. Capture, set and restore the Ghost mode.
	(Expand_N_Subprogram_Declaration): Capture, set and restore the
	Ghost mode.
	(Restore_Globals): New routine.
	* exp_ch7.adb Add with and use clauses for Ghost.
	(Expand_N_Package_Body): Capture, set and restore the Ghost mode.
	(Expand_N_Package_Declaration): Capture, set and restore the
	Ghost mode.
	(Wrap_HSS_In_Block): Create a proper identifier for the block.
	* exp_ch8.adb Add with and use clauses for Ghost.
	(Expand_N_Exception_Renaming_Declaration): Code
	cleanup. Capture, set and restore the Ghost mode.
	(Expand_N_Object_Renaming_Declaration): Capture, set and restore
	the Ghost mode.
	(Expand_N_Package_Renaming_Declaration): Capture, set and restore the
	Ghost mode.
	(Expand_N_Subprogram_Renaming_Declaration): Capture, set and
	restore the Ghost mode.
	* exp_ch11.adb (Expand_N_Exception_Declaration): Code
	cleanup. Capture, set and restore the Ghost mode.
	* exp_disp.adb (Make_DT): Update the call to Set_Ghost_Mode. Do
	not initialize the dispatch table slot of a Ghost subprogram.
	* exp_prag.adb Add with and use clauses for Ghost.
	(Expand_Pragma_Check): Capture, set and restore the Ghost mode.
	(Expand_Pragma_Contract_Cases): Capture, set and restore the
	Ghost mode.
	(Expand_Pragma_Initial_Condition): Capture, set and
	restore the Ghost mode.
	(Expand_Pragma_Loop_Variant): Capture,
	set and restore the Ghost mode.
	(Restore_Globals): New routine.
	* exp_util.adb Add with and use clauses for Ghost.
	(Make_Predicate_Call): Code cleanup. Capture, set and restore
	the Ghost mode.
	(Restore_Globals): New routine.
	* freeze.adb (Freeze_Entity): Code cleanup. Update the call
	to Set_Ghost_Mode.
	* ghost.adb Add with and use clause for Sem_Prag.
	(Check_Ghost_Completion): Code cleanup.
	(Check_Ghost_Overriding): New routine.
	(Check_Ghost_Policy): Code cleanup.
	(Ghost_Entity): New routine.
	(Is_Ghost_Declaration): Removed.
	(Is_Ghost_Statement_Or_Pragma): Removed.
	(Is_OK_Context): Reimplemented.
	(Is_OK_Declaration): New routine.
	(Is_OK_Pragma): New routine.
	(Is_OK_Statement): New routine.
	(Mark_Full_View_As_Ghost): New routine.
	(Mark_Pragma_As_Ghost): New routine.
	(Mark_Renaming_As_Ghost): New routine.
	(Propagate_Ignored_Ghost_Code): Update the comment on usage.
	(Set_From_Entity): New routine.
	(Set_From_Policy): New routine.
	(Set_Ghost_Mode): This routine now handles pragmas and freeze nodes.
	(Set_Ghost_Mode_For_Freeze): Removed.
	(Set_Ghost_Mode_From_Entity): New routine.
	(Set_Ghost_Mode_From_Policy): Removed.
	* ghost.ads (Check_Ghost_Overriding): New routine.
	(Mark_Full_View_As_Ghost): New routine.
	(Mark_Pragma_As_Ghost): New routine.
	(Mark_Renaming_As_Ghost): New routine.
	(Set_Ghost_Mode): Update the parameter profile. Update the
	comment on usage.
	(Set_Ghost_Mode_For_Freeze): Removed.
	(Set_Ghost_Mode_From_Entity): New routine.
	* sem_ch3.adb (Analyze_Full_Type_Declaration):
	Capture and restore the Ghost mode. Mark a type
	as Ghost regardless of whether it comes from source.
	(Analyze_Incomplete_Type_Decl): Capture, set and restore the
	Ghost mode.
	(Analyze_Number_Declaration): Capture and restore the Ghost mode.
	(Analyze_Object_Declaration): Capture and restore the Ghost mode.
	(Analyze_Private_Extension_Declaration): Capture and
	restore the Ghost mode.
	(Analyze_Subtype_Declaration): Capture and restore the Ghost mode.
	(Process_Full_View): The full view inherits all Ghost-related
	attributes from the private view.
	(Restore_Globals): New routine.
	* sem_ch5.adb (Analyze_Assignment): Capture and restore the
	Ghost mode.
	(Restore_Globals): New routine.
	* sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration):
	Code cleanup. Capture and restore the Ghost mode. Mark a
	subprogram as Ghost regarless of whether it comes from source.
	(Analyze_Procedure_Call): Capture and restore the Ghost mode.
	(Analyze_Subprogram_Body_Helper): Capture and restore the Ghost mode.
	(Analyze_Subprogram_Declaration): Capture and restore the Ghost mode.
	(New_Overloaded_Entity): Ensure that a
	parent subprogram and an overriding subprogram have compatible
	Ghost policies.
	* sem_ch7.adb (Analyze_Package_Body_Helper): Capture and restore
	the Ghost mode.
	(Analyze_Package_Declaration): Capture and
	restore the Ghost mode. Mark a package as Ghost when it is
	declared in a Ghost region.
	(Analyze_Private_Type_Declaration): Capture and restore the Ghost mode.
	(Restore_Globals): New routine.
	* sem_ch8.adb (Analyze_Exception_Renaming): Code
	reformatting. Capture and restore the Ghost mode. A renaming
	becomes Ghost when its name references a Ghost entity.
	(Analyze_Generic_Renaming): Capture and restore the Ghost mode. A
	renaming becomes Ghost when its name references a Ghost entity.
	(Analyze_Object_Renaming): Capture and restore the Ghost mode. A
	renaming becomes Ghost when its name references a Ghost entity.
	(Analyze_Package_Renaming): Capture and restore the Ghost mode. A
	renaming becomes Ghost when its name references a Ghost entity.
	(Analyze_Subprogram_Renaming): Capture and restore the Ghost
	mode. A renaming becomes Ghost when its name references a
	Ghost entity.
	* sem_ch11.adb (Analyze_Exception_Declaration): Capture, set
	and restore the Ghost mode.
	* sem_ch12.adb (Analyze_Generic_Package_Declaration): Capture and
	restore the Ghost mode.
	(Analyze_Generic_Subprogram_Declaration):
	Capture and restore the Ghost mode.
	* sem_ch13.adb Add with and use clauses for Ghost.
	(Add_Invariant): New routine.
	(Add_Invariants): Factor out code.
	(Add_Predicate): New routine.
	(Add_Predicates): Factor out code.
	(Build_Invariant_Procedure_Declaration): Code cleanup. Capture,
	set and restore the Ghost mode.
	(Build_Invariant_Procedure): Code cleanup.
	(Build_Predicate_Functions): Capture, set and
	restore the Ghost mode. Mark the generated functions as Ghost.
	* sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
	Capture, set and restore the Ghost mode.
	(Analyze_External_Property_In_Decl_Part): Capture, set and restore
	the Ghost mode.
	(Analyze_Initial_Condition_In_Decl_Part):
	Capture, set and restore the Ghost mode.
	(Analyze_Pragma):
	Code cleanup. Capture, set and restore the Ghost mode. Flag
	pragmas Linker_Section, No_Return, Unmodified, Unreferenced and
	Unreferenced_Objects as illegal when it applies to both Ghost
	and living arguments. Pragma Ghost cannot apply to synchronized
	objects.
	(Check_Kind): Moved to the spec of Sem_Prag.
	(Process_Inline): Flag the pragma as illegal when it applies to
	both Ghost and living arguments.
	(Restore_Globals): New routine.
	* sem_prag.ads Add pragma Default_Initial_Condition
	to table Assertion_Expression_Pragma. Add new table
	Is_Aspect_Specifying_Pragma.
	(Check_Kind): Moved from body of Sem_Prag.
	* sem_util.adb Add with and use clauses for Ghost.
	(Build_Default_Init_Cond_Procedure_Body): Capture, set and restore
	the Ghost mode.
	(Build_Default_Init_Cond_Procedure_Declaration):
	Capture, set and restore the Ghost mode. Mark the default
	initial condition procedure as Ghost when it is declared
	in a Ghost region.
	(Is_Renaming_Declaration): New routine.
	(Policy_In_List): Account for the single argument version of
	Check_Pragma.
	* sem_util.ads (Is_Renaming_Declaration): New routine.
	* sinfo.adb (Is_Ghost_Pragma): New routine.
	(Set_Is_Ghost_Pragma): New routine.
	* sinfo.ads New attribute Is_Ghost_Pragma.
	(Is_Ghost_Pragma): New routine along with pragma Inline.
	(Set_Is_Ghost_Pragma): New routine along with pragma Inline.

From-SVN: r223684
2015-05-26 12:46:58 +02:00
Torvald Riegel
138cac6426 Fix memory order description in atomic ops built-ins docs.
From-SVN: r223683
2015-05-26 10:45:56 +00:00
Arnaud Charlet
b68cf874f6 [multiple changes]
2015-05-26  Robert Dewar  <dewar@adacore.com>

	* sem_ch3.adb, sem_aux.adb, sem_aux.ads, exp_ch6.adb, sprint.adb:
	Minor reformatting.

2015-05-26  Gary Dismukes  <dismukes@adacore.com>

	* gnat1drv.adb, targparm.adb, targparm.ads, restrict.adb: Minor
	reformatting and typo fixes in comments.

2015-05-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch7.adb (Swap_Private_Dependets): Set visibility of
	the two views of a private dependent in two separate steps,
	to ensure proper visibility in parent units analyzed for inlining.

From-SVN: r223682
2015-05-26 12:42:26 +02:00
Yannick Moy
ff1bedacc8 sem_aux.adb, [...] (Get_Low_Bound): Use Type_Low_Bound.
2015-05-26  Yannick Moy  <moy@adacore.com>

	* sem_aux.adb, sem_aux.ads (Get_Low_Bound): Use Type_Low_Bound.
	(Package_Body, Package_Spec): New queries moved
	here from GNATprove.
	(Package_Specification): Simplify query to remove use of loop.
	* sem_util.adb, sem_util.ads (Enclosing_Declaration,
	Enclosing_Package_Or_Subprogram, Is_Attribute_Update): New
	queries moved here from GNATprove.

From-SVN: r223681
2015-05-26 12:40:39 +02:00
Arnaud Charlet
a7b3792787 [multiple changes]
2015-05-26  Bob Duff  <duff@adacore.com>

	* einfo.adb, einfo.ads, sprint.adb, lib-xref.ads: Minor cleanup: Remove
	obsolete Entity_Kinds E_String_Type and E_String_Subtype. Update
	redundant assertions.

2015-05-26  Gary Dismukes  <dismukes@adacore.com>

	* sem_util.adb, sem_util.ads, sem_ch13.adb: Minor typo fixes.

From-SVN: r223680
2015-05-26 12:39:16 +02:00
Arnaud Charlet
8349613899 [multiple changes]
2015-05-26  Doug Rupp  <rupp@adacore.com>

	* init.c [vxworks]: Refine previous checkin.

2015-05-26  Robert Dewar  <dewar@adacore.com>

	* exp_ch4.adb (Wrap_MA): New function.
	(Expand_N_Op_Expon): Use Wrap_MA.

2015-05-26  Bob Duff  <duff@adacore.com>

	* exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration):
	Do not use secondary stack to return limited records with
	defaulted discriminants. This is an efficiency improvement.
	* exp_ch6.adb, exp_dist.adb, sem_attr.adb, sem_aux.adb, sem_aux.ads,
	sem_ch12.adb, sem_ch3.adb, sem_ch4.adb, sem_ch6.adb, sem_ch7.adb,
	sem_util.adb: Change the sense of Is_Indefinite_Subtype to be
	Is_Definite_Subtype. This is an improvement to readability (the double
	negative in "not Is_Indefinite_Subtype" was slightly confusing). Also
	disallow passing non-[sub]type entities, an unnecessary and slightly
	bug-prone flexibility.

From-SVN: r223679
2015-05-26 12:35:14 +02:00
Arnaud Charlet
596b25f9a1 [multiple changes]
2015-05-26  Robert Dewar  <dewar@adacore.com>

	* sem_aggr.adb (Resolve_Array_Aggregate): Defend against
	bad bounds.
	* debug.adb: Document -gnatd.k.
	* erroutc.adb (Set_Msg_Insertion_Line_Number): Implement -gnatd.k.

2015-05-26  Robert Dewar  <dewar@adacore.com>

	* gnat1drv.adb (Gnat1drv): Provide new arguments for
	Get_Target_Parameters.
	* restrict.adb (Set_Restriction_No_Specification_Of_Aspect):
	new procedure.
	(Set_Restriction_No_Use_Of_Attribute): new procedure.
	* restrict.ads (Set_Restriction_No_Specification_Of_Aspect):
	new procedure.
	(Set_Restriction_No_Use_Of_Attribute): new procedure.
	* s-rident.ads (Integer_Parameter_Restrictions): New subtype.
	* targparm.adb (Get_Target_Parameters): Allow new restriction
	pragmas No_Specification_Of_Aspect No_Use_Of_Attribute
	No_Use_Of_Pragma.
	* targparm.ads: New parameters for Get_Target_Parameters.
	* tbuild.adb (Set_NOD): New name for Set_RND.
	(Set_NSA): New procedure.
	(Set_NUA): New procedure.
	(Set_NUP): New procedure.
	* tbuild.ads (Make_SC): Minor reformatting.
	(Set_NOD): New name for Set_RND.
	(Set_NSA, Set_NUA, Set_NUP): New procedure.

2015-05-26  Ed Schonberg  <schonberg@adacore.com>

	* a-stwise.adb (Find_Token): If source'first is not positive,
	an exception must be raised, as specified by RM 2005 A.4.3
	(68/1). This must be checked explicitly, given that run-time
	files are normally compiled without constraint checks.
	* a-stzsea.adb (Find_Token): Ditto.

2015-05-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_util.ads sem_util.adb (Is_Current_Instance):  New predicate
	to fully implement RM 8.6 (17/3). which earlier only applied
	to synchronized types. Used to preanalyze aspects that include
	current instances of types, such as Predicate and Invariant.
	* sem_res.adb (Resolve_Entity_Name): Use Is_Current_Instance.
	* sem_ch13.adb (Add_Predicates): In ASIS mode, preserve original
	expression of aspect and analyze it to provide proper type
	information.

2015-05-26  Robert Dewar  <dewar@adacore.com>

	* rtsfind.ads: Add entries for RE_Exn[_Long]_Float.
	* s-exnllf.adb (Exn_Float): New function.
	(Exn_Long_Float): New function.
	(Exn_Long_Long_Float): Rewritten interface.
	(Exp): New name for what used to be Exn_Long_Long_Float.
	* s-exnllf.ads (Exn_Float): New function.
	(Exn_Long_Float): New function.

2015-05-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Find_Selected_Component): Do not emit an error
	on a selected component when the prefix is a type name that is
	a Current_Instance.
	* einfo.ads: Minor grammar fix.

2015-05-26  Doug Rupp  <rupp@adacore.com>

	* init.c [vxworks] (sysLib.h): Only for x86.

From-SVN: r223678
2015-05-26 12:29:25 +02:00
Paul Thomas
1b961de9db re PR fortran/66082 (memory leak with automatic array dummy argument with derived type array constructor actual argument)
2015-05-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/66082
	* trans-array.c (gfc_conv_array_parameter): Ensure that all
	non-variable arrays with allocatable components have the
	components deallocated after the procedure call.

2015-05-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/66082
	* gfortran.dg/allocatable_scalar_13.f90: New test

From-SVN: r223677
2015-05-26 10:20:41 +00:00
Jonathan Wakely
4a72a6ddd2 locale_conv.h: Fix copyright years.
* include/bits/locale_conv.h: Fix copyright years.
	* include/bits/quoted_string.h: Likewise.
	* src/filesystem/Makefile.am: Likewise.
	* testsuite/22_locale/conversions/buffer/1.cc: Likewise.
	* testsuite/22_locale/conversions/buffer/requirements/typedefs.cc:
	Likewise.
	* testsuite/22_locale/conversions/string/1.cc: Likewise.
	* testsuite/22_locale/conversions/string/2.cc: Likewise.
	* testsuite/22_locale/conversions/string/3.cc: Likewise.
	* testsuite/22_locale/conversions/string/requirements/typedefs-2.cc:
	Likewise.
	* testsuite/22_locale/conversions/string/requirements/typedefs.cc:
	Likewise.
	* testsuite/util/testsuite_fs.h: Likewise.

From-SVN: r223676
2015-05-26 10:52:25 +01:00
Arnaud Charlet
556d1a44c8 [multiple changes]
2015-05-26  Doug Rupp  <rupp@adacore.com>

	* init-vxsim.c (CPU): define as __VXSIM_CPU__
	* sigtramp-vxworks-vxsim.c (CPU): Likewise.
	sigtramp-vxworks-target.inc: Add check for SIMLINUX.
	* sigtramp.h: Likewise.

2015-05-26  Robert Dewar  <dewar@adacore.com>

	* sem_aux.adb, sem_disp.adb, sem_util.ads: Add comment.
	* sem_util.adb: Minor reformatting

From-SVN: r223675
2015-05-26 11:42:58 +02:00
Yannick Moy
90a4b33679 inline.adb (Has_Initialized_Type): Adapt to new names.
2015-05-26  Yannick Moy  <moy@adacore.com>

	* inline.adb (Has_Initialized_Type): Adapt to new names.
	* sem_aux.adb, sem_aux.ads (Get_Low_Bound, Number_Components,
	Subprogram_Body, Subprogram_Body_Entity, Subprogram_Spec,
	Subprogram_Specification): New query functions used in GNATprove.
	* sem_disp.adb, sem_disp.ads (Is_Overriding_Subprogram): New
	query functions used in GNATprove.
	* sem_util.adb, sem_util.adso (Enclosing_Lib_Unit_Node,
	Get_Cursor_Type, Get_Return_Object, Get_User_Defined_Eq,
	Is_Double_Precision_Floating_Point_Type,
	Is_Single_Precision_Floating_Point_Type): New query functions
	used in GNATprove.

From-SVN: r223674
2015-05-26 11:35:07 +02:00
Arnaud Charlet
35fd12d804 [multiple changes]
2015-05-26  Bob Duff  <duff@adacore.com>

	* s-rpc.ads (Partition_ID): Increase maximum Partition_ID to
	some huge number.
	* a-except-2005.adb, a-except-2005.ads, a-except.adb,
	a-except.ads, a-exexda.adb, a-exstat.adb: Minor comment fixes.

2015-05-26  Robert Dewar  <dewar@adacore.com>

	* sinfo.adb: Minor comment addition.
	* einfo.adb: Minor whitespace and punctuation fix.
	* sem_util.adb: Minor editing of comments.

From-SVN: r223673
2015-05-26 11:33:01 +02:00
Arnaud Charlet
e8c84c8fc3 [multiple changes]
2015-05-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch7.adb (Install_Private_Declarations,
	Swap_Private_Dependents): Ensure that both views of the dependent
	subtype are immediately visible if we are within their scope. This
	may be needed when a procedure body is both the parent of an
	instantiated child unit, and is itself used to inline a local
	function.

2015-05-26  Gary Dismukes  <dismukes@adacore.com>

	* exp_prag.adb, gnat1drv.adb: Minor reformatting.

2015-05-26  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_ch4.adb (Expand_N_Indexed_Component): In the circuit
	detecting exceptions to the rewriting, deal with implicit
	dereferences in the selected component case.

2015-05-26  Bob Duff  <duff@adacore.com>

	* sem_ch13.adb (Analyze_One_Aspect): Do not
	require the expression of the Disable_Controlled aspect to be
	static in a generic template, because 'Enabled is not known
	until the instance.

2015-05-26  Doug Rupp  <rupp@adacore.com>

	* init-vxsim.c: New file for vxsim ZCX
	* sigtramp-vxworks-vxsim.c: Likewise.
	* sigtramp-vxworks.c: Factor out target dependent bits into ...
	* sigtramp-vxworks-target.inc: ... here.
	* sigtramp.h: Add vxsim zcx protos.
	* init.c [vxworks...] (sysLib.h): Include.
	(__gnat_map_signal): Make global.
	 [...i386] (__gnat_error_handler): Call __gnat_vxsim_error_handler if
	on vxsim.
	[...i386] (__gnat_install_handler): Test if on vxsim.

2015-05-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch5.adb (Analyze_Iterator_Specification): For an element
	iterator over an array, if the component is aliased, the loop
	variable is aliased as well.

2015-05-26  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch6.adb (Expand_Actuals): For a function call with in-out
	parameters that is rewritten as an expression_with_actions,
	we preserve the original function call node for further use by
	the caller (typically Expand_Call). In the presence of validity
	checks, that function call, though it is labelled Analyzed to
	prevent an infinite recursion, may be rewritten as a temporary
	by Remove_Side_Effects.  Ensure that the caller has access to
	the original function call to continue expansion.
	* atree.ads: Minor typo in comment.

2015-05-26  Javier Miranda  <miranda@adacore.com>

	* sem_util.adb (Check_Function_Writable_Actuals):
	Add missing support to check the violation of writable actuals
	in array aggregates that have a nonstatic range.

From-SVN: r223672
2015-05-26 11:28:14 +02:00
Hristian Kirtchev
b9eb3aa8a2 exp_ch6.adb (Process_Contract_Cases_For): Update the call to Expand_Pragma_Contract_Cases.
2015-05-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch6.adb (Process_Contract_Cases_For): Update the call to
	Expand_Pragma_Contract_Cases.
	* exp_prag.ads, exp_prag.adb (Expand_Contract_Cases): Rename to
	Expand_Pragma_Contract_Cases.
	* sem_ch13.adb (Add_Invariants): Use the original aspect name
	when creating the arguments of pragma Check. This ensures that
	'Class is properly recognized and handled.

From-SVN: r223671
2015-05-26 11:20:53 +02:00
Richard Biener
a12e42fc3d tree-vect-loop.c (vect_update_vf_for_slp): Split out from ...
2015-05-26  Richard Biener  <rguenther@suse.de>

	* tree-vect-loop.c (vect_update_vf_for_slp): Split out from ...
	(vect_analyze_loop_operations): ... here.  Remove slp parameter,
	detect whether we apply SLP.  Remove call to
	vect_update_slp_costs_according_to_vf.
	(vect_analyze_loop_2): Call vect_update_vf_for_slp and
	vect_update_slp_costs_according_to_vf from here.  Dispatch
	to vect_slp_analyze_operations to analyze SLP stmts.
	* tree-vect-slp.c (vect_slp_analyze_node_operations): Drop
	unused bb_vec_info parameter, adjust assert.
	(vect_slp_analyze_operations): Pass in the slp instance tree
	instead of bb_vec_info.
	(vect_slp_analyze_bb_1): Adjust call to vect_slp_analyze_operations.
	* tree-vectorizer.h (vect_slp_analyze_operations): Declare.

From-SVN: r223670
2015-05-26 09:03:53 +00:00
Arnaud Charlet
213999c233 gnat1drv.adb: Minor adjustments.
* gnat1drv.adb: Minor adjustments.
	(Adjust_Global_Switches): Disable some related flags in CodePeer mode.
	* sem_ch4.adb (Has_Arbitrary_Evaluation_Order,
	Stop_Subtree_Climbind): Code cleanup.
	* einfo.ads: Minor comment change.

From-SVN: r223669
2015-05-26 10:19:55 +02:00
Arnaud Charlet
22e89283f7 [multiple changes]
2015-05-26  Javier Miranda  <miranda@adacore.com>

	* sem_aggr.adb (Resolve_Aggregate, Resolve_Extension_Aggregate):
	Code cleanup.
	* sem_ch3.adb (Build_Derived_Record_Type,
	Record_Type_Declaration): Code cleanup.
	* sem_ch4.adb (Has_Arbitrary_Evaluation_Order,
	Stop_Subtree_Climbind): Tables which speed up the identification
	of dangerous calls to Ada 2012 functions with writable actuals
	(AI05-0144).
	(Analyze_Arithmetic_Op, Analyze_Call, Analyze_Comparison_Op,
	Analyze_Equality_Op, Analyze_Logical_Op, Analyze_Membership_Op,
	Analyze_Range): Code cleanup.
	(Is_Arbitrary_Evaluation_Order_Construct): Removed.
	(Check_Writable_Actuals): Code cleanup using the added tables.
	* sem_util.adb (Check_Function_Writable_Actuals): Return
	immediately if the node does not have the flag Check_Actuals
	set to True.

2015-05-26  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_ch6.adb (Add_Call_By_Copy_Code): Remove restrictive
	condition in the detection of the effects of Remove_Side_Effects.
	* exp_util.ads (Remove_Side_Effects): Add general and historical note.
	* exp_util.adb (Is_Name_Reference): New predicate.
	(Remove_Side_Effects): Use it in lieu of Is_Object_Reference
	in order to decide whether to use the renaming to capture the
	side effects of the subexpression.
	(Side_Effect_Free): Remove obsolete test.

From-SVN: r223668
2015-05-26 10:17:51 +02:00
Arnaud Charlet
c859345327 [multiple changes]
2015-05-26  Robert Dewar  <dewar@adacore.com>

	* aspects.ads, aspects.adb: Add aspect Disable_Controlled.
	* einfo.ads, einfo.adb (Disable_Controlled): New flag.
	(Is_Controlled_Active): New function.
	* exp_ch3.adb (Expand_Freeze_Record_Type): Use
	Is_Controlled_Active.
	* exp_util.adb (Needs_Finalization): Finalization not needed
	if Disable_Controlled set.
	* freeze.adb (Freeze_Array_Type): Do not set
	Has_Controlled_Component if the component has Disable_Controlled.
	(Freeze_Record_Type): ditto.
	* sem_ch13.adb (Decorate): Minor reformatting.
	(Analyze_Aspect_Specifications): Implement Disable_Controlled.
	* sem_ch3.adb (Analyze_Object_Declaration): Handle
	Disable_Controlled.
	(Array_Type_Declaration): ditto.
	(Build_Derived_Private_Type): ditto.
	(Build_Derived_Type): ditto.
	(Record_Type_Definition): ditto.
	* snames.ads-tmpl: Add Name_Disable_Controlled.

2015-05-26  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_ch6.adb (Expand_Actuals): Use a constant declaration instead
	of a renaming to capture the return value of a function call.
	(Expand_Simple_Function_Return): Call Remove_Side_Effects
	instead of removing side effects manually before the call to
	_Postconditions.

From-SVN: r223667
2015-05-26 10:15:24 +02:00
Arnaud Charlet
2945460b98 Minor reformatting.
From-SVN: r223666
2015-05-26 10:12:26 +02:00
Robert Dewar
5389e4ae85 exp_ch4.adb (Expand_N_Op_Expon): Deal with problem of wrong order in calling Duplicate_Subexpr.
2015-05-26  Robert Dewar  <dewar@adacore.com>

	* exp_ch4.adb (Expand_N_Op_Expon): Deal with problem of wrong
	order in calling Duplicate_Subexpr.
	* einfo.ads: Fix documentation of Object/Value size for scalar types.

From-SVN: r223665
2015-05-26 10:12:15 +02:00
Ed Schonberg
ffcfb997e0 exp_aggr.adb (Build_Array_Aggr_Code, Gen_Assign): If a component is default-initialized and its type has an invariant procedure...
2015-05-26  Ed Schonberg  <schonberg@adacore.com>

	* exp_aggr.adb (Build_Array_Aggr_Code, Gen_Assign):
	If a component is default-initialized and its type has an
	invariant procedure, insert an invariant test after code for
	default-initialization of the component.

From-SVN: r223664
2015-05-26 10:10:46 +02:00
Arnaud Charlet
551e193501 [multiple changes]
2015-05-26  Gary Dismukes  <dismukes@adacore.com>

	* einfo.ads, sem_util.adb, sem_ch4.adb: Minor reformatting.

2015-05-26  Robert Dewar  <dewar@adacore.com>

	* exp_unst.adb, exp_unst.ads: Change to using Subps table index for
	making AREC entity names unique.

2015-05-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_cat.adb (Has_Stream_Attribute_Definition): If the type
	has aspect specifications, examine the corresponding list of
	representation items to determine whether there is a visible
	stream operation. The attribute definition clause generated from
	the aspect will be inserted at the freeze point of the type,
	which may be in the private part and not directly visible,
	but the aspect makes the operation available to a client.

From-SVN: r223663
2015-05-26 10:08:03 +02:00
Robert Dewar
07aa5e6fa1 sem_util.adb: Minor code reorganization.
2015-05-26  Robert Dewar  <dewar@adacore.com>

	* sem_util.adb: Minor code reorganization.
	* sem_ch6.adb: Minor reformatting.

From-SVN: r223662
2015-05-26 10:06:51 +02:00
GCC Administrator
70ce46792a Daily bump.
From-SVN: r223661
2015-05-26 00:16:19 +00:00
Eric Botcazou
f42dd37fa3 utils.c (maybe_pad_type): Do not apply adjustment to original size for elementary types before issuing...
* gcc-interface/utils.c (maybe_pad_type): Do not apply adjustment to
	original size for elementary types before issuing the size warning.

From-SVN: r223657
2015-05-25 21:30:39 +00:00
Eric Botcazou
1366ba411a targtyps.c (get_float_words_be): Rename into...
* gcc-interface/targtyps.c (get_float_words_be): Rename into...
	(get_target_float_words_be): ...this.
	(get_words_be): Rename into...
	(get_target_words_be): ...this.
	(get_bytes_be): Rename into...
	(get_target_bytes_be): ...this.
	(get_bits_be): Rename into...
	(get_target_bits_be): ...this.
	* gcc-interface/gigi.h (standard_datatypes): Remove ADT_ptr_void_type.
	(ptr_void_type_node): Delete.
	(get_target_float_size): Likewise.
	(get_target_double_size): Likewise.
	(get_target_long_double_size): Likewise.
	(get_float_words_be): Likewise.
	(get_words_be): Likewise.
	(get_bytes_be): Likewise.
	(get_bits_be): Likewise.
	(get_target_float_words_be): Declare.
	(get_target_words_be): Likewise.
	(get_target_bytes_be): Likewise.
	(get_target_bits_be): Likewise.
	* gcc-interface/decl.c (gnat_to_gnu_entity): Replace ptr_void_type_node
	with ptr_type_node.
	(intrin_return_compatible_p): Likewise.
	* gcc-interface/trans.c (gigi): Likewise.
	* gcc-interface/utils2.c (maybe_wrap_malloc): Likewise.
	(maybe_wrap_free): Likewise.
	* gcc-interface/utils.c (maybe_pad_type): Remove superfluous space.
	* gcc-interface/misc.c (gnat_init): Do not set ptr_void_type_node.

From-SVN: r223656
2015-05-25 21:12:39 +00:00
Eric Botcazou
bf44701f95 decl.c (elaborate_expression): Take a const string suffix instead of a tree.
* gcc-interface/decl.c (elaborate_expression): Take a const string
	suffix instead of a tree.
	(elaborate_expression_1): Likewise.
	(elaborate_expression_2): Likewise.
	(gnat_to_gnu_entity): Adjust to above changes.
	(build_subst_list): Likewise.
	(get_entity_char): New static function.

From-SVN: r223655
2015-05-25 21:09:25 +00:00
Eric Botcazou
5277688be0 decl.c (gnat_to_gnu_entity): Move around.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Move around.
	<E_Exception>: Merge with E_Variable case.
	<E_Variable>: Remove 'object' label.

From-SVN: r223654
2015-05-25 21:05:03 +00:00
Eric Botcazou
2117b9bb98 decl.c (gnat_to_gnu_entity): Minor tweak.
* gcc-interface/decl.c (gnat_to_gnu_entity): Minor tweak.
	* gcc-interface/trans.c (finalize_nrv_unc_r): Use CONSTRUCTOR_ELT.
	* gcc-interface/utils.c (convert): Likewise and simplify.
	(remove_conversions): Likewise.
	* gcc-interface/utils2.c (compare_fat_pointers): Likewise.
	(build_unary_op): Likewise and simplify.

From-SVN: r223653
2015-05-25 20:59:27 +00:00
Eric Botcazou
f797c2b745 gigi.h (build_atomic_load): Adjust prototype.
* gcc-interface/gigi.h (build_atomic_load): Adjust prototype.
	(build_atomic_store): Likewise.
	(build_load_modify_store): Declare.
	(VECTOR_TYPE_P): Delete.
	* gcc-interface/decl.c (gnat_to_gnu_entity): Replace Is_Atomic with
	Is_Atomic_Or_VFA throughout.
	<E_Array_Type>: Build a variant of the XUA type instead of forcing
	TYPE_VOLATILE on it.
	<E_Array_Subtype>: Use the main variant of the base type.
	Do not force TYPE_VOLATILE on the type being built.
	<E_Record_Type>: Likewise.
	<E_Array_Subtype>: Likewise.
	<E_Subprogram_Type>: Rename local variable.
	Add Atomic qualifier in conjunction with Volatile on types if needed.
	Force BLKmode for by-ref types only at the end of the processing.
	Change qualifiers only after changing the mode of the type.  Set
	TYPE_UNIVERSAL_ALIASING_P on the type directly.
	(check_ok_for_atomic_type): Issue specific error message for VFA.
	(gnat_to_gnu_component_type): Replace Is_Atomic with
	Is_Atomic_Or_VFA throughout.
	* gcc-interface/misc.c (gnat_get_alias_set): Test
	TYPE_UNIVERSAL_ALIASING_P on the type directly.
	* gcc-interface/trans.c (lvalue_required_p): Replace Is_Atomic with
	Is_Atomic_Or_VFA throughout.  Add missing guard.
	(node_is_atomic): New predicate.
	(node_has_volatile_full_access): Likewise.
	(gnat_strip_type_conversion): New function.
	(outer_atomic_access_required_p): New predicate.
	(atomic_sync_required_p): Rename into...
	(atomic_access_required_p): ...this.  Add SYNC parameter, scan the
	parent node first and then look for the atomic setting.  Add support
	for Volatile_Full_Access.
	(Call_to_gnu): Add atomic_access and outer_atomic_access parameters
	and adjusts calls to above functions.  Use load-modify-store sequence
	for updates of In/Out and Out parameters if required, as well as for
	moving the result to the target if required.  Add couple of missing
	guards.
	(gnat_to_gnu): Adjust calls to above functions.
	<N_Object_Renaming_Declaration>: If the renamed object has side-effects
	evaluate only its address.
	<N_Assignment_Statement>: Adjust call to Call_to_gnu.  Use load-modify
	store sequence if required.
	<N_Function_Call>: Adjust call to Call_to_gnu.
	(extract_values): Adjust comment.
	* gcc-interface/utils2.c (build_atomic_load): Add SYNC parameter and
	use relaxed memory model if it is not set.
	(build_atomic_store): Likewise.
	(call_is_atomic_load): New predicate.
	(build_load_modify_store): New function.
	(build_binary_op) <MODIFY_EXPR>: Accept SAVE_EXPR on the LHS.
	(gnat_stabilize_reference) <CALL_EXPR>: Deal with atomic loads.

From-SVN: r223652
2015-05-25 20:18:44 +00:00
Alexander Monakov
2e24efd3f4 i386.h (enum reg_class): Move CLOBBERED_REGS prior to Q_REGS.
* config/i386/i386.h (enum reg_class): Move CLOBBERED_REGS prior to
	Q_REGS.  Expand comment.
	(REG_CLASS_NAMES): Ditto.
	(REG_CLASS_CONTENTS): Ditto.
testsuite:
	* gcc.target/i386/pr66232-1.c: Adjust scan pattern.
	* gcc.target/i386/pr66232-3.c: Likewise.

From-SVN: r223650
2015-05-25 21:07:26 +03:00
Uros Bizjak
979455ea0e re PR target/66274 (gcc6: x86 -m32 emits 64bit register in inline asm)
PR target/66274
	* config/i386/i386.c (print_reg): Only print "r" for TARGET_64BIT
	when LEGACY_INT_REGNO_P is processed.

testsuite/ChangeLog:

	PR target/66274
	* gcc.target/i386/pr66274.c: New test.

From-SVN: r223649
2015-05-25 19:49:28 +02:00
Alexander Monakov
4ea9e6c799 * config/i386/i386.c (ix86_function_ok_for_sibcall): Check flag_plt.
From-SVN: r223648
2015-05-25 20:44:45 +03:00
Pitchumani Sivanupandi
9e46366d37 avr.c (avr_out_load_psi_reg_no_disp_tiny): Restore base register if not marked dead/unused, before return.
* config/avr/avr.c (avr_out_load_psi_reg_no_disp_tiny): Restore base
	register if not marked dead/unused, before return.

From-SVN: r223647
2015-05-25 19:43:05 +03:00
Marek Polacek
9677ef526d * c-ubsan.c (ubsan_instrument_shift): Use type0.
From-SVN: r223646
2015-05-25 15:46:01 +00:00
Eric Botcazou
ea29244832 ada-tree.h (DECL_RENAMING_GLOBAL_P): Rename into...
* gcc-interface/ada-tree.h (DECL_RENAMING_GLOBAL_P): Rename into...
	(DECL_GLOBAL_NONCONSTANT_RENAMING_P): ...this.
	* gcc-interface/gigi.h (record_global_renaming_pointer): Delete.
	(invalidate_global_renaming_pointers): Likewise.
	(record_global_nonconstant_renaming): New.
	(invalidate_global_nonconstant_renamings): Likewise.
	(get_inner_constant_reference): Likewise.
	(gnat_constant_reference_p): Likewise.
	* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Adjust to above
	and register the renaming pointer only if the object is non-constant.
	(elaborate_expression_1): Call get_inner_constant_reference instead
	of get_inner_reference.
	* gcc-interface/trans.c (fold_constant_decl_in_expr): Minor tweak.
	(Identifier_to_gnu): Adjust to above and do not recheck the renamed
	object before substituting it.
	(Compilation_Unit_to_gnu): Adjust to above renaming.  Minor tweaks.
	(gnat_to_gnu) <N_Object_Renaming_Declaration>: Do not return the
	result at the global level.
	(N_Exception_Renaming_Declaration): Likewise.
	* gcc-interface/utils.c (global_renaming_pointers): Rename into...
	(global_nonconstant_renamings): ...this.
	(destroy_gnat_utils): Adjust to above renaming.
	(record_global_renaming_pointer): Rename into...
	(record_global_nonconstant_renaming): ...this.
	(invalidate_global_renaming_pointers): Rename into...
	(invalidate_global_nonconstant_renamings): ...this and do not recheck
	the renamed object before invalidating.
	* gcc-interface/utils2.c (gnat_stabilize_reference): Minor tweak.
	(get_inner_constant_reference): New public function.
	(gnat_constant_reference_p): New predicate.

From-SVN: r223644
2015-05-25 14:00:28 +00:00
Javier Miranda
288cbbbdac einfo.ads, einfo.adb (Has_Out_Or_In_Out_Parameter): This attribute is now present in subprograms...
2015-05-25  Javier Miranda  <miranda@adacore.com>

	* einfo.ads, einfo.adb (Has_Out_Or_In_Out_Parameter): This attribute
	is now present in subprograms, generic subprograms, entries and
	entry families.
	* sem_ch6.adb (Set_Formal_Mode): Set As_Out_Or_In_Out_Parameter
	on entries, entry families, subprograms and generic subprograms.
	* sem_ch12.adb (Analyze_Generic_Subprogram_Declaration):
	Minor code reorganization to ensure that the Ekind attribute
	of the subprogram entity is set before its formals are
	processed. Required to allow the use of the attribute
	Has_Out_Or_In_Out_Parameter on the subprogram entity.
	* sem_aggr.adb (Resolve_Aggregate, Resolve_Extension_Aggregate):
	Perform the check on writable actuals only if the value of some
	component of the aggregate involves calling a function with
	out-mode parameters.
	(Resolve_Record_Aggregate): Propagate the Check_Actuals flag to the
	internally built aggregate.
	* sem_ch3.adb (Build_Derived_Record_Type, Record_Type_Declaration):
	Perform the check on writable actuals only if the initialization of
	some component involves calling a function with out-mode parameters.
	* sem_ch4.adb (Analyze_Arithmetic_Op, Analyze_Comparison_Op,
	Analyze_Equality_Op, Analyze_Logical_Op, Analyze_Membership_Op,
	Analyze_Range): Check writable actuals only if the
	subtrees have a call to a function with out-mode parameters
	(Analyze_Call.Check_Writable_Actuals): New subprogram. If the call
	has out or in-out parameters then mark its outermost enclosing
	construct as a node on which the writable actuals check must
	be performed.
	(Analyze_Call): Check if the flag must be set and if the outermost
	enclosing construct.
	* sem_util.adb (Check_Function_Writable_Actuals): Code cleanup
	and reorganization. We skip processing aggregate discriminants
	since their precise analysis involves two phases traversal.
	* sem_res.adb (Resolve_Actuals, Resolve_Arithmetic_Op,
	Resolve_Logical_Op, Resolve_Membership_Op): Remove call to
	check_writable_actuals.

From-SVN: r223643
2015-05-25 14:37:37 +02:00
Andreas Tobler
277420210d pr64317.c: Use 'dg-require-effective-target ia32' and 'dg-require-effective-target pie'.
2015-05-25  Andreas Tobler  <andreast@gcc.gnu.org>

        * gcc.target/i386/pr64317.c: Use 'dg-require-effective-target ia32'
	and 'dg-require-effective-target pie'.

From-SVN: r223642
2015-05-25 10:50:43 +02:00
GCC Administrator
627eba4c6f Daily bump.
From-SVN: r223640
2015-05-25 00:16:14 +00:00
Nathan Sidwell
6f2d72e0e1 re PR c++/66243 (enum class value is allowed to be initialized by value from other enum class)
cp/
	PR c++/66243
	* decl.c (build_enumerator): Don't silently convert scoped enums.

	testsuite/
	PR c++/66243
	* g++.dg/cpp0x/pr66243.C: New.

From-SVN: r223636
2015-05-24 23:17:58 +00:00
Eric Botcazou
bce0e38df9 * configure: Regenerate.
From-SVN: r223635
2015-05-24 21:58:37 +00:00
Uros Bizjak
98ce5ba507 * ChangLog: Fix whitespace.
From-SVN: r223634
2015-05-24 21:57:47 +02:00
Jan Hubicka
233ce28925 re PR lto/66180 (many -Wodr false positives when building LLVM with -flto)
PR lto/66180
	* ipa-devirt.c (type_with_linkage): Check that TYPE_STUB_DECL
	is set; check for assembler name at LTO time.
	(type_in_anonymous_namespace): Remove hacks, check that all
	anonymous types are called "<anon>"
	(odr_type_p): Simplify; add check for "<anon>"
	(odr_subtypes_equivalent): Add odr_type_p check.
	* tree.c (need_assembler_name_p): Even anonymous namespace needs
	assembler name.
	* mangle.c (mangle_decl): Mangle anonymous namespace types as
	"<anon>".
	* g++.dg/lto/pr66180_0.C: New testcase.
	* g++.dg/lto/pr66180_1.C: New testcase.

From-SVN: r223633
2015-05-24 19:38:14 +00:00
Mikael Morin
bc0c7f396b re PR fortran/66257 (ELEMENTAL procedure pointer component XX is not allowed as an actual argument)
PR fortran/66257
gcc/fortran/
	* resolve.c (resolve_actual_arglist): Don't throw an error
	if the argument with procedure pointer component is not a variable.
gcc/testsuite/
	* typebound_call_27.f90: New file.

From-SVN: r223631
2015-05-24 14:55:50 +00:00
Jan Hubicka
70e7f2a2df ipa-utils.h (method_class_type): Remove.
* ipa-utils.h (method_class_type): Remove.
	* cgraphunit.c (walk_polymorphic_call_targets): Use TYPE_METHOD_BASETYPE.
	* ipa-devirt.c (type_in_anonymous_namespace_p): Check that it is called
	on main variants only.
	(method_class_type): Remove.
	(update_type_inheritance_graph): Use TYPE_METHOD_BASETYPE.
	(build_type_inheritance_graph): Likewise.
	* ipa-icf.c (sem_function::equals_wpa): Likewise.
	* pa-polymorphic-call.c (decl_maybe_in_construction_p, 
	check_stmt_for_type_change): Use TYPE_METHOD_BASETYPE.

From-SVN: r223629
2015-05-24 06:13:44 +00:00
Jan Hubicka
66f0bbd50c tree.c (prototype_p, [...]): Constify.
* tree.c (prototype_p, virtual_method_call_p, obj_type_ref_class,
	is_typedef_decl, typedef_variant_p): Constify.
	* tree.h (prototype_p, virtual_method_call_p, obj_type_ref_class,
	is_typedef_decl, typedef_variant_p): Constify.

From-SVN: r223628
2015-05-24 04:22:35 +00:00
Trevor Saunders
0e5f14d420 add default for HAVE_tablejump
gcc/ChangeLog:

2015-05-23  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* defaults.h (gen_tablejump): New function.
	(HAVE_tablejump): Add default value.
	* expr.c: Adjust.
	* stmt.c: Likewise.

From-SVN: r223625
2015-05-24 00:33:06 +00:00
Trevor Saunders
b77eb5eb02 add default for HAVE_store_multiple
gcc/ChangeLog:

2015-05-23  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* defaults.h (gen_store_multiple): New function.
	(HAVE_store_multiple): Add default value.
	* expr.c (move_block_from_reg): Adjust.

From-SVN: r223624
2015-05-24 00:33:00 +00:00
Trevor Saunders
e51f0f4f35 add default for HAVE_load_multiple
gcc/ChangeLog:

2015-05-23  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* defaults.h (gen_load_multiple): New function.
	(HAVE_load_multiple): Add default value.
	* expr.c (move_block_to_reg): Adjust.

From-SVN: r223623
2015-05-24 00:32:54 +00:00
Trevor Saunders
15469812ac provide default for HAVE_mem_signal_fence
gcc/ChangeLog:

2015-05-23  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* defaults.h (gen_mem_signal_fence): New function.
	(HAVE_mem_signal_fence): Add default value.
	* optabs.c: Adjust.

From-SVN: r223622
2015-05-24 00:32:49 +00:00