Commit Graph

151587 Commits

Author SHA1 Message Date
Arnaud Charlet
4b7fd13182 [multiple changes]
2017-01-23  Justin Squirek  <squirek@adacore.com>

	* exp_strm.ads, exp_strm.ads
	(Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
	as to avoid getting the underlying type by default.
	* exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
	underlying type in the Iiput and output attribute cases when
	building their respective functions.

2017-01-23  Gary Dismukes  <dismukes@adacore.com>

	* scng.adb: Minor reformatting of error message.

2017-01-23  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (Analyze_Expression_Function): Do not attempt
	to freeze the return type of an expression funxtion that is a
	completion, if the type is a limited view and the non-limited
	view is available.

From-SVN: r244805
2017-01-23 14:20:22 +01:00
Richard Biener
cffcafda6a re PR tree-optimization/79186 (ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: Segmentation fault (in VRP))
2017-01-23  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79186
	* tree-vrp.c (register_new_assert_for): Make sure we've seen
	both incoming edges before moving an assert.

	* gcc.dg/torture/pr79186.c: New testcase.
	* gcc.dg/torture/pr79187.c: Likewise.

From-SVN: r244804
2017-01-23 13:08:44 +00:00
Martin Jambor
bda2bc48c2 Fix compute_complex_assign_jump_func
2017-01-23  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.c (load_from_param_1): Removed.
	(load_from_unmodified_param): Bits from load_from_param_1 put back
	here.
	(load_from_param): Removed.
	(compute_complex_assign_jump_func): Removed stmt2 and just replaced it
	with stmt.  Reverted back to use of load_from_unmodified_param.

testsuite/
	* gcc.dg/ipa/vrp8.c: New test.

From-SVN: r244803
2017-01-23 14:05:00 +01:00
Martin Jambor
f65f1ae3b9 [PR 79108] Put ipa_node_params to GC memory
2017-01-23  Martin Jambor  <mjambor@suse.cz>

	PR ipa/79108
	* ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()).
	(ipa_node_params): Annotate with GTY((for_user)).  Make descriptors
	field a pointer to garbage collected vector, mark lattices and
	ipcp_orig_node with GTY((skip)).
	(ipa_get_param_count): Adjust to descriptors being a pointer.
	(ipa_get_param): Likewise.
	(ipa_get_type): Likewise.
	(ipa_get_param_move_cost): Likewise.
	(ipa_set_param_used): Likewise.
	(ipa_get_controlled_uses): Likewise.
	(ipa_set_controlled_uses): Likewise.
	(ipa_is_param_used): Likewise.
	(ipa_node_params_t): Move into garbage collector.  New methods insert
	and remove.
	(ipa_node_params_sum): Annotate wth GTY(()).
	(ipa_check_create_node_params): Adjust to ipa_node_params_sum being
	garbage collected.
	(ipa_load_from_parm_agg): Adjust declaration.
	* ipa-icf.c (param_used_p): Adjust to descriptors being a pointer.
	* ipa-profile.c (ipa_profile): Likewise.
	* ipa-prop.c (ipa_get_param_decl_index_1): Likewise.
	(ipa_populate_param_decls): Make descriptors parameter garbage
	collected.
	(ipa_dump_param): Adjust to descriptors being a pointer.
	(ipa_alloc_node_params): Likewise.
	(ipa_initialize_node_params): Likewise.
	(load_from_param_1): Make descriptors parameter garbage collected.
	(load_from_unmodified_param): Likewise.
	(load_from_param): Likewise.
	(ipa_load_from_parm_agg): Likewise.
	(ipa_node_params::~ipa_node_params): Removed.
	(ipa_free_all_node_params): Remove call to delete operator.
	(ipa_node_params_t::insert): New.
	(ipa_node_params_t::remove): Likewise.
	(ipa_node_params_t::duplicate): Adjust to descriptors being a pointer,
	copy known_csts and known_contexts vectors.
	(ipa_read_node_info): Adjust to descriptors being a pointer.
	(ipcp_modif_dom_walker): Make m_descriptors field garbage
	collected.
	(ipcp_transform_function): Make descriptors variable garbage
	collected.

testsuite/
	* gfortran.dg/lto/pr79108_0.f90: New test.

From-SVN: r244802
2017-01-23 14:01:31 +01:00
Andrew Senkevich
dea061117a Add AVX512 k-mask intrinsics
gcc/
	* config/i386/avx512bwintrin.h: Add k-mask test, kortest intrinsics.
	* config/i386/avx512dqintrin.h: Ditto.
	* config/i386/avx512fintrin.h: Ditto.
	* gcc/config/i386/i386.c: Handle new builtins.
	* config/i386/i386-builtin.def: Add new builtins.
	* config/i386/sse.md (ktest<mode>, kortest<mode>): New.
	(UNSPEC_KORTEST, UNSPEC_KTEST): New.

gcc/testsuite/
	* gcc.target/i386/avx512bw-ktestd-1.c: New test.
	* gcc.target/i386/avx512bw-ktestq-1.c: Ditto.
	* gcc.target/i386/avx512dq-ktestb-1.c: Ditto.
	* gcc.target/i386/avx512f-ktestw-1.c: Ditto.
	* gcc.target/i386/avx512bw-kortestd-1.c: Ditto.
	* gcc.target/i386/avx512bw-kortestq-1.c: Ditto.
	* gcc.target/i386/avx512dq-kortestb-1.c: Ditto.
	* gcc.target/i386/avx512f-kortestw-1.c: Ditto.
	* gcc.target/i386/avx512bw-ktestd-2.c: Ditt
	* gcc.target/i386/avx512bw-ktestq-2.c: Ditto.
	* gcc.target/i386/avx512dq-ktestb-2.c: Ditto.
	* gcc.target/i386/avx512f-ktestw-2.c: Ditto.
	* gcc.target/i386/avx512bw-kortestd-2.c: Ditto.
	* gcc.target/i386/avx512bw-kortestq-2.c: Ditto.
	* gcc.target/i386/avx512dq-kortestb-2.c: Ditto.
	* gcc.target/i386/avx512f-kortestw-2.c: Ditto.

From-SVN: r244801
2017-01-23 12:52:39 +00:00
Richard Biener
050116183b re PR testsuite/78421 (vect-strided-a-u8-i2-gap.c fails on armeb)
PR testsuite/78421
	* lib/target-supports.exp (check_effective_target_vect_hw_misalign):
	If the target is ARM return the result of the
	check_effective_target_arm_vect_no_misalign proc.
	* gcc.dg/vect/vect-strided-a-u8-i2-gap.c: If the target does not
	support unaligned vectors then only expect one of the loops to be
	unrolled.

Co-Authored-By: Nick Clifton <nickc@redhat.com>

From-SVN: r244796
2017-01-23 12:24:35 +00:00
Arnaud Charlet
42f9f0fc72 Minor editing.
From-SVN: r244795
2017-01-23 13:08:22 +01:00
Arnaud Charlet
9eb8d5b4e9 [multiple changes]
2017-01-23  Ed Schonberg  <schonberg@adacore.com>

	* par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
	aggregate construct.
	(P_Record_Or_Array_Component_Association): An array aggregate
	can start with an Iterated_Component_Association.
	* scng.adb: Modify error message on improper use of @ in earlier
	versions of the language.
	* sinfo.ads: New node kind N_Delta_Aggregate.
	* sinfo.adb: An N_Delta_Aggregate has component associations and
	an expression.
	* sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
	* sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
	Create a new index for each one of the choices in the association,
	to prevent spurious homonyms in the scope.
	(Resolve_Delta_Aggregate): New.
	* sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
	* exp_util.adb (Insert_Actions): Take into account
	N_Delta_Aggregate.
	* exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
	* exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
	and local procedures Expand_Delta_Array_Aggregate and
	expand_Delta_Record_Aggregate.
	* sprint.adb: Handle N_Delta_Aggregate.

2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
	empty name when the exception declaration is subject to pragma
	Discard_Names.
	(Null_String): New routine.

2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* par-ch9.adb (P_Protected_Definition): Parse
	any optional and potentially illegal pragmas which appear in
	a protected operation declaration list.
	(P_Task_Items): Parse
	any optional and potentially illegal pragmas which appear in a
	task item list.

From-SVN: r244794
2017-01-23 13:07:34 +01:00
Martin Liska
f6b9f2ffc1 use-after-scope: handle writes to a poisoned variable
2017-01-23  Martin Liska  <mliska@suse.cz>

	* gcc.dg/asan/use-after-scope-10.c: New test.
	* gcc.dg/asan/use-after-scope-11.c: New test.
	* g++.dg/asan/use-after-scope-5.C: New test.
2017-01-23  Jakub Jelinek  <jakub@redhat.com>
	    Martin Liska  <mliska@suse.cz>

	* asan.h: Define ASAN_USE_AFTER_SCOPE_ATTRIBUTE.
	* asan.c (asan_expand_poison_ifn): Support stores and use
	appropriate ASAN report function.
	* internal-fn.c (expand_ASAN_POISON_USE): New function.
	* internal-fn.def (ASAN_POISON_USE): Declare.
	* tree-into-ssa.c (maybe_add_asan_poison_write): New function.
	(maybe_register_def): Create ASAN_POISON_USE when sanitizing.
	* tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove
	ASAN_POISON calls w/o LHS.
	* tree-ssa.c (execute_update_addresses_taken): Create clobber
	for ASAN_MARK (UNPOISON, &x, ...) in order to prevent usage of a LHS
	from ASAN_MARK (POISON, &x, ...) coming to a PHI node.
	* gimplify.c (asan_poison_variables): Add attribute
	use_after_scope_memory to variables that really needs to live
	in memory.
	* tree-ssa.c (is_asan_mark_p): Do not rewrite into SSA when
	having the attribute.

From-SVN: r244793
2017-01-23 12:06:13 +00:00
Arnaud Charlet
a51368fad9 [multiple changes]
2017-01-23  Pascal Obry  <obry@adacore.com>

	* s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
	is needed when a foreign thread call a Win32 API using a thread handle
	like GetThreadTimes() for example.

2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
	allow an 'Address clause to be specified on a prefix of a
	class-wide type.

2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* checks.adb (Insert_Valid_Check): Ensure that the prefix of
	attribute 'Valid is a renaming of the original expression when
	the expression denotes a name. For all other kinds of expression,
	use a constant to capture the value.
	* exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
	* sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.

2017-01-23  Justin Squirek  <squirek@adacore.com>

	* sem_eval.adb (Eval_Integer_Literal): Add special
	case to avoid optimizing out check if the literal appears in
	an if-expression.

From-SVN: r244792
2017-01-23 13:04:16 +01:00
Martin Liska
c7775327e8 Speed up use-after-scope (v2): rewrite into SSA
2017-01-23  Martin Liska  <mliska@suse.cz>

	* asan.c (create_asan_shadow_var): New function.
	(asan_expand_poison_ifn): Likewise.
	* asan.h (asan_expand_poison_ifn): New declaration.
	* internal-fn.c (expand_ASAN_POISON): Likewise.
	* internal-fn.def (ASAN_POISON): New builtin.
	* sanopt.c (pass_sanopt::execute): Expand
	asan_expand_poison_ifn.
	* tree-inline.c (copy_decl_for_dup_finish): Make function
	external.
	* tree-inline.h (copy_decl_for_dup_finish): Likewise.
	* tree-ssa.c (is_asan_mark_p): New function.
	(execute_update_addresses_taken): Rewrite local variables
	(identified just by use-after-scope as addressable) into SSA.
2017-01-23  Martin Liska  <mliska@suse.cz>

	* gcc.dg/asan/use-after-scope-3.c: Add additional flags.
	* gcc.dg/asan/use-after-scope-9.c: Likewise and grep for
	sanopt optimization for ASAN_POISON.

From-SVN: r244791
2017-01-23 12:02:13 +00:00
Ed Schonberg
913e4b3617 sem_ch4.adb (Try_Primitive_Operations, [...]): argument is valid if it is a derived type with unknown discriminants that...
2017-01-23  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch4.adb (Try_Primitive_Operations,
	Is_Valid_First_Argument_Of): argument is valid if it is a derived
	type with unknown discriminants that matches its underlying
	record view.
	* exp_util.adb (Expand_Subtype_From_Expr): Do not expand
	expression if its type is derived from a limited type with
	unknown discriminants, because the expansion (which is a call)
	must be expanded in the enclosing context to add the proper build-
	in-place parameters to the call.
	* lib.ads, exp_ch9.adb: Minor fixes in comments.

From-SVN: r244790
2017-01-23 13:00:26 +01:00
Arnaud Charlet
a77152ca85 [multiple changes]
2017-01-23  Yannick Moy  <moy@adacore.com>

	* frontend.adb (Frontend): Do not load runtime
	unit for GNATprove when parsing failed.
	* exp_ch9.adb: minor removal of extra whitespace
	* exp_ch6.adb: minor typo in comment
	* sem_util.adb: Code cleanup.
	* exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
	* a-ngcefu.adb: minor style fix in whitespace

2017-01-23  Thomas Quinot  <quinot@adacore.com>

	* scos.ads: Document usage of 'd' as default SCO kind for
	declarations.
	* par_sco.adb (Traverse_Declarations_Or_Statements.
	Traverse_Degenerate_Subprogram): New supporting routine for expression
	functions and null procedures.
	(Traverse_Declarations_Or_Statements.Traverse_One): Add
	N_Expression_Function to the subprogram case; add required
	support for null procedures and expression functions.

2017-01-23  Bob Duff  <duff@adacore.com>

	* namet.ads (Bounded_String): Decrease the size of type
	Bounded_String to avoid running out of stack space.
	* namet.ads (Append): Don't ignore buffer overflow; raise
	Program_Error instead.

From-SVN: r244789
2017-01-23 12:57:27 +01:00
Arnaud Charlet
d43584ca12 [multiple changes]
2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
	sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
	reformatting.
	* exp_ch9.adb: minor style fix in comment.

2017-01-23  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
	for a limited record extension with unknown discriminants whose
	full view has no discriminants.

2017-01-23  Yannick Moy  <moy@adacore.com>

	* exp_spark.adb: Alphabetize with clauses.

From-SVN: r244788
2017-01-23 12:54:05 +01:00
Arnaud Charlet
0f83b0444c [multiple changes]
2017-01-23  Gary Dismukes  <dismukes@adacore.com>

	* a-calend.adb, prep.adb, debug.adb, prj.ads, prepcomp.adb,
	exp_disp.adb, s-imgrea.adb, g-socket.adb, g-socket.ads, sem_ch13.adb,
	prj-tree.ads: Minor spelling change for consistency (behaviour ->
	behavior).

2017-01-23  Ed Schonberg  <schonberg@adacore.com>

	* scng.adb (Scan): Use Ada version Ada_2020 to flag use of
	Target_Name.
	* par-ch4.adb (P_Primary): Ditto.
	* opt.ads: Add Ada_2020 (optimistically) to enumeration list of
	Ada_Version_Type.
	* switch-c.adb (Scan_Front_End_Switches): Recognize -gnat2020 for
	new Ada version Ada_2020.

2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_attr.adb (Expand_Loop_Entry_Attribute): Force the generation
	of a nominal type for the constant which captures the value of
	the attribute prefix. Various clean ups.
	* sem_attr.adb (Analyze_Attribute): Clean up the processing of
	'Loop_Entry.

2017-01-23  Yannick Moy  <moy@adacore.com>

	* sem_util.adb (Has_Enabled_Property): Treat
	protected objects and variables differently from other variables.

From-SVN: r244787
2017-01-23 12:51:26 +01:00
Thomas Quinot
52b70b1bef sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Split original Ada 95 part off into new subprogram below.
2017-01-23  Thomas Quinot  <quinot@adacore.com>

	* sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
	Split original Ada 95 part off into new subprogram
	below. Call that subprogram (instead of proceeding with
	AI95-0133 behaviour) if debug switch -gnatd.p is in use.
	(Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
	* debug.adb Document new switch -gnatd.p
	* freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
	record for reverse bit order if an error has already been posted
	on the record type.  This avoids generating extraneous "info:"
	messages for illegal code.

From-SVN: r244786
2017-01-23 12:33:13 +01:00
Justin Squirek
2a02fa985d sem_ch3.adb (Analyze_Declarations): Correct comments
2017-01-23  Justin Squirek  <squirek@adacore.com>

	* sem_ch3.adb (Analyze_Declarations): Correct comments
	* freeze.adb (Find_Constant): Add detection of deferred constants
	so they are not incorrectly flagged as premature.

From-SVN: r244785
2017-01-23 12:31:25 +01:00
Arnaud Charlet
15e2e3f57e Minor reformatting.
From-SVN: r244784
2017-01-23 12:29:46 +01:00
Ed Schonberg
ae33543ca5 scans.ads: New token At_Sign.
2017-01-23  Ed Schonberg  <schonberg@adacore.com>

	* scans.ads: New token At_Sign. Remove '@' from list of illegal
	characters for future version of the language. '@' is legal name.
	* scng.ads, scng.adb (Scan):  Handle '@' appropriately.
	* scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
	denotes a Target_Name.
	* par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
	* sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
	(Has_Target_Names): New flag on N_Assignment_Statement, to
	indicate that RHS has occurrences of N_Target_Name.
	* sem.adb: Call Analyze_Target_Name.
	* sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
	(urrent_LHS): Global variable that denotes LHS of assignment,
	used in the analysis of Target_Name nodes.
	* sem_res.adb (Resolve_Target_Name): New procedure.
	* exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
	N is an assignment statement whose RHS contains occurences of @
	that designate the value of the LHS of the assignment. If the
	LHS is side-effect free the target names can be replaced with
	a copy of the LHS; otherwise the semantics of the assignment
	is described in terms of a procedure with an in-out parameter,
	and expanded as such.
	(Expand_N_Assignment_Statement): Call
	Expand_Assign_With_Target_Names when needed.
	* exp_util.adb (Insert_Actions): Take into account N_Target_Name.
	* sprint.adb: Handle N_Target_Name.

From-SVN: r244783
2017-01-23 12:29:17 +01:00
Arnaud Charlet
13230c68da [multiple changes]
2017-01-23  Eric Botcazou  <ebotcazou@adacore.com>

	* checks.adb: Minor fix in comment.

2017-01-23  Philippe Gil  <gil@adacore.com>

	* g-debpoo.adb (Do_Report) remove freed chunks from chunks
	count in Sort = Memory_Usage or Allocations_Count

2017-01-23  Justin Squirek  <squirek@adacore.com>

	* sem_ch3.adb: Code cleanup.

2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
	variables to the local variable section. Update the profile
	of various nested routine that previously had visibility
	of those globals. One the matching phase has completed,
	remove certain classes of clauses which are considered noise.
	(Check_Dependency_Clause): Properly detect a match between two
	'Result attributes. Update the various post-match cases to use
	Is_Already_Matched as this routine now automatically recognizes
	a previously matched 'Result attribute.
	(Is_Already_Matched): New routine.
	(Remove_Extra_Clauses): New routine.
	(Report_Extra_Clauses): Remove the detection of ... => null
	clauses as this is now done in Remove_Extra_Clauses.

From-SVN: r244782
2017-01-23 12:27:01 +01:00
Arnaud Charlet
0d1e3cc995 Fix typo.
From-SVN: r244781
2017-01-23 12:24:32 +01:00
Arnaud Charlet
6adb6030c1 [multiple changes]
2017-01-23  Ed Schonberg  <schonberg@adacore.com>

	* sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
	report on spurious overlaps between values involving a subtype
	with a static predicate, because the expansion of such a subtype
	into individual ranges in inhibited in ASIS mode.

2017-01-23  Justin Squirek  <squirek@adacore.com>

	* sem_ch3.adb (Analyze_Declarations): Add detection
	of an edge case and delay freezing if it is present.

From-SVN: r244780
2017-01-23 12:23:48 +01:00
Kyrylo Tkachov
d8ae8d1601 [testsuite] Fix FAIL: gcc.dg/lto/pr69188 on bare-metal targets
PR lto/69188
	* gcc.dg/lto/pr69188_0.c: Require profiling support for testcase.

From-SVN: r244779
2017-01-23 11:22:54 +00:00
Hristian Kirtchev
f991bd8ec9 sem_ch3.adb, [...]: Minor reformatting.
2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
	sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.

2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* freeze.adb (Freeze_Subprogram): Ensure that all anonymous
	access-to-subprogram types inherit the convention of the
	associated subprogram.	(Set_Profile_Convention): New routine.
	* sem_ch6.adb (Check_Conformance): Do not compare the conventions
	of the two entities directly, use Conventions_Match to account
	for anonymous access-to-subprogram and subprogram types.
	(Conventions_Match): New routine.

From-SVN: r244778
2017-01-23 12:21:37 +01:00
Claire Dross
d553a695b9 exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes which return Universal_Integer...
2017-01-23  Claire Dross  <dross@adacore.com>

	* exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
	which return Universal_Integer, force the overflow check flag for
	Length and Range_Length for types as big as Long_Long_Integer.

From-SVN: r244777
2017-01-23 12:19:56 +01:00
Arnaud Charlet
6d67bea921 [multiple changes]
2017-01-23  Claire Dross  <dross@adacore.com>

	* exp_spark.adb (Expand_SPARK_Attribute_Reference):  For
	attributes which return Universal_Integer, introduce a conversion
	to the expected type with the appropriate check flags set.
	* sem_res.adb (Resolve_Range): The higher bound can be in Typ's
	base type if the range is null. It may still be invalid if it
	is higher than the lower bound. This is checked later in the
	context in which the range appears.

2017-01-23  Pierre-Marie de Rodat  <derodat@adacore.com>

	* scos.ads: Introduce a constant to represent ignored
	dependencies in SCO_Unit_Table_Entry.

From-SVN: r244776
2017-01-23 12:19:07 +01:00
Arnaud Charlet
64a4f612f9 [multiple changes]
2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
	spaces from error messages.

2017-01-23  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch3.adb (Check_Large_Modular_Array): New procedure,
	subsidiary to Expand_N_Object_ Declaration, to compute a guard on
	an object declaration for an array type with a modular index type
	with the size of Long_Long_Integer. Special processing is needed
	in this case to compute reliably the size of the object, and
	eventually  to raise Storage_Error, when wrap-around arithmetic
	might compute a meangingless size for the object.

2017-01-23  Justin Squirek  <squirek@adacore.com>

	* a-wtenau.adb, par-endh.adb, sem_prag.adb,
	sem_type.adb: Code cleanups.

From-SVN: r244775
2017-01-23 12:17:23 +01:00
Bob Duff
be4e989cd1 sem_res.adb (Resolve_Call): In the part of the code where it is deciding whether to turn the call into an...
2017-01-23  Bob Duff  <duff@adacore.com>

	* sem_res.adb (Resolve_Call): In the part of the code where
	it is deciding whether to turn the call into an indexed
	component, avoid doing so if the call is to an instance of
	Unchecked_Conversion. Otherwise, the compiler turns it into an
	indexed component, and resolution of that turns it back into a
	function call, and so on, resulting in infinite recursion.
	* sem_util.adb (Needs_One_Actual): If the first formal has a
	default, then return False.

From-SVN: r244774
2017-01-23 12:13:23 +01:00
Maxim Ostapenko
e3d53f96ed re PR lto/79061 ([LTO][ASAN] LTO plus ASAN fails with "AddressSanitizer: initialization-order-fiasco")
Revert fix for PR lto/79061 due to this regresses compile-time by 100%
on some fortran cases.

From-SVN: r244773
2017-01-23 11:12:29 +02:00
Christophe Lyon
54d7c70c08 [ARM,AArch64][testsuite] Fix format string in AdvSIMD tests.
2017-01-23  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h (CHECK_POLY): New.
	(CHECK_RESULTS_NAMED_NO_FP16): Call CHECK_POLY instead of CHECK
	for poly*_t types.
	* gcc.target/aarch64/advsimd-intrinsics/vcnt.c (FNNAME): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vcombine.c (void
	exec_vcombine): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vcreate.c (FNNAME): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vget_high.c (void exec_vget_high): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vget_low.c (void exec_vget_low): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vldX.c (void exec_vldX): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vldX_dup.c (void exec_vldX_dup): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vldX_lane.c (void exec_vldX_lane): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vmul.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vmvn.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vqtbX.c (void exec_vqtbX): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vreinterpret_p128.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vrev.c (void exec_vrev): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vsXi_n.inc: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vshuffle.inc: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vsli_n.c (void vsli_extra): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vsri_n.c (void vsri_extra): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vstX_lane.c (void exec_vstX_lane): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vtbX.c (void exec_vtbX): Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/p64_p128.c (int main):
	Likewise.
	(TEST_VGET_LANE): Cast to uint to avoid warning.
	* gcc.target/aarch64/advsimd-intrinsics/unary_sat_op.inc (void
	FNNAME): Fix PRIx format for int16_t, int32_t, uint16_t, uint32_t.
	* gcc.target/aarch64/advsimd-intrinsics/vfms_vfma_n.c (void
	exec_vfma_vfms_n): Fix PRIx format for float64_t.
	* gcc.target/aarch64/advsimd-intrinsics/vmovn.c (void exec_vmovn):
	Fix PRIx format for int8_t, int16_t, uint8_t, uint16_t.
	* gcc.target/aarch64/advsimd-intrinsics/vmul_lane.c (void
	exec_vmul_lane): Fix PRIx format for int16_t, uint16_t.
	* gcc.target/aarch64/advsimd-intrinsics/vmul_n.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vmull.c (void exec_vmull):
	Fix PRIx format for int16_t, int64_t, uint16_t, uint64_t. Call
	CHECK_POLY instead of CHECK for poly64_t types.
	* gcc.target/aarch64/advsimd-intrinsics/vmull_lane.c (void
	exec_vmull_lane): Fix PRIx format for int64_t, uint64_t.
	* gcc.target/aarch64/advsimd-intrinsics/vpXXX.inc:
	Fix PRIx format for int8_t, int16_t, uint8_t, uint16_t.
	* gcc.target/aarch64/advsimd-intrinsics/vqabs.c (void
	vqabs_extra): Fix PRIx format for int16_t, int32_t, uint16_t,
	uint32_t.
	* gcc.target/aarch64/advsimd-intrinsics/vqdmull.c: Fix PRIx format
	for int32_t, int64_t.
	* gcc.target/aarch64/advsimd-intrinsics/vqneg.c (void
	vqneg_extra): Fix PRIx format for int16_t, int32_t.
	* gcc.target/aarch64/advsimd-intrinsics/vreinterpret_p64.c
	(TEST_VREINTERPRET_TO_POLY): New. (main): Call
	TEST_VREINTERPRET_TO_POLY instead of TEST_VREINTERPRET where
	needed.

From-SVN: r244772
2017-01-23 09:56:36 +01:00
Gerald Pfeifer
f9e37186cc patch_tester.sh (TESTLOGS): Remove $TARGET/libjava/testsuite/libjava.sum.
* patch_tester.sh (TESTLOGS): Remove
	$TARGET/libjava/testsuite/libjava.sum.

From-SVN: r244771
2017-01-23 07:24:15 +00:00
Gerald Pfeifer
cd30831311 * doc/xml/manual/debug.xml: code.google.com uses https now.
From-SVN: r244770
2017-01-23 07:18:42 +00:00
GCC Administrator
8fcd76ca59 Daily bump.
From-SVN: r244769
2017-01-23 00:16:16 +00:00
Gerald Pfeifer
eec5428b70 * warn_summary: Remove the -java option.
From-SVN: r244766
2017-01-22 20:53:48 +00:00
Gerald Pfeifer
630f989317 * doc/xml/manual/test.xml: Fix link into gccint online manual.
From-SVN: r244765
2017-01-22 20:39:06 +00:00
Gerald Pfeifer
b99d68f5be install.texi (Specific): opensource.apple.com uses https now.
* doc/install.texi (Specific): opensource.apple.com uses https
	now. Remove trailing slash.

From-SVN: r244764
2017-01-22 20:29:34 +00:00
Jakub Jelinek
386fe51c2b re PR fortran/79154 (omp declare simd in pure function?)
PR fortran/79154
	* parse.c (matchs, matcho, matchds, matchdo): Replace return st;
	with { ret = st; goto finish; }.
	(decode_omp_directive): Allow declare simd, declare target and
	simd directives in PURE/ELEMENTAL procedures.  Only call
	gfc_unset_implicit_pure on successful match of other procedures.

	* gfortran.dg/gomp/pr79154-1.f90: New test.
	* gfortran.dg/gomp/pr79154-2.f90: New test.

From-SVN: r244763
2017-01-22 20:36:57 +01:00
Matthias Klose
0f314c78c2 2017-01-22 Matthias Klose <doko@ubuntu.com>
* Import zlib 1.2.11.
        * configure: Regenerate.

Changes in 1.2.11 (15 Jan 2017)
- Fix deflate stored bug when pulling last block from window
- Permit immediate deflateParams changes before any deflate input

From-SVN: r244762
2017-01-22 18:07:04 +00:00
Gerald Pfeifer
8d86f71798 * README.Portability: Remove note on an Irix compatibility issue.
From-SVN: r244759
2017-01-22 15:52:02 +00:00
Dimitry Andric
6aed7ed0c2 gcov.c (INCLUDE_ALGORITHM): Define.
* gcov.c (INCLUDE_ALGORITHM): Define.
	(INCLUDE_VECTOR): Define.
	No longer include <vector> and <algorithm> directly.

From-SVN: r244758
2017-01-22 15:48:21 +00:00
Andreas Schwab
bc4d86e626 * gcc.dg/tree-ssa/pr77445-2.c: Quote brackets.
From-SVN: r244757
2017-01-22 12:46:39 +00:00
GCC Administrator
cad0ea3aa5 Daily bump.
From-SVN: r244756
2017-01-22 00:16:13 +00:00
Gerald Pfeifer
e51290d7b8 extend.texi (Thread-Local): Change www.akkadia.org reference to https.
* doc/extend.texi (Thread-Local): Change www.akkadia.org reference
	to https.
	* doc/invoke.texi (Code Gen Options): Ditto.

From-SVN: r244751
2017-01-21 21:53:32 +00:00
Gerald Pfeifer
d294599af2 gfc-internals.texi (Symbol Versioning): Change references to www.akkadia.org to https.
* gfc-internals.texi (Symbol Versioning): Change references
	to www.akkadia.org to https.

From-SVN: r244750
2017-01-21 20:37:01 +00:00
Jan Hubicka
a6a70dcad2 re PR lto/78407 (LTO breaks separate overriding of symbol aliases)
PR lto/78407
	* cfg.c (update_bb_profile_for_threading): Fix updating of probablity.

From-SVN: r244749
2017-01-21 19:36:01 +00:00
Ville Voutilainen
509912a611 Make poisoned hashes SFINAE away the call operator of the hash.
* include/bits/functional_hash.h
(__poison_hash::__enable_hash_call): New.
* include/std/optional (__optional_hash_call_base): New.
(hash<optional<_Tp>>): Derive from the new base,
move the hash function into that base.
* include/std/variant (__variant_hash_call_base_impl): New.
(__variant_hash_call_base): Likewise.
(hash<variant<_Types...>>): Derive from the new base,
move the hash function into that base.
* testsuite/20_util/optional/hash.cc: Add tests for is_callable.
* testsuite/20_util/variant/hash.cc: Likewise.

From-SVN: r244748
2017-01-21 17:38:23 +02:00
Marek Polacek
c31d5fcecf re PR testsuite/79169 (g++.dg/warn/Wduplicated-branches1.C fails on powerpc since its introduction in r244705)
PR testsuite/79169
	* g++.dg/warn/Wduplicated-branches1.C: Use signed char.

From-SVN: r244747
2017-01-21 12:00:40 +00:00
Jan Hubicka
25cb56c3a0 * gcc.dg/tree-ssa/pr77445-2.c: Adjust template.
From-SVN: r244746
2017-01-21 11:33:44 +00:00
Eric Botcazou
22564ca916 sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc) optimizations when...
* sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
	optimizations when the type is modular and the offsets are equal.

From-SVN: r244745
2017-01-21 11:10:00 +00:00
Jakub Jelinek
51f03c6b11 gfortran.h (gfc_extract_int): Change return type to bool.
* gfortran.h (gfc_extract_int): Change return type to bool.  Add
	int argument with = 0.
	* decl.c (gfc_match_kind_spec): Adjust gfc_extract_int caller, pass
	1 as new last argument to it, don't emit gfc_error.
	(match_char_kind): Likewise.
	(gfc_match_decl_type_spec): Use gfc_get_string ("%s", x) instead of
	gfc_get_string (x).
	(gfc_match_derived_decl, match_binding_attributes): Likewise.
	(gfc_match_structure_decl): Don't sprintf back to name, call
	get_struct_decl directly with gfc_dt_upper_string (name) result.
	* trans-stmt.c (gfc_trans_allocate): Use gfc_get_string ("%s", x)
	instead of gfc_get_string (x).
	* module.c (gfc_dt_lower_string, gfc_dt_upper_string,
	gfc_match_use, gfc_match_submodule, find_true_name, mio_pool_string,
	mio_symtree_ref, mio_expr, mio_omp_udr_expr, load_generic_interfaces,
	load_omp_udrs, load_needed, read_module, dump_module,
	create_intrinsic_function, import_iso_c_binding_module,
	create_int_parameter, create_int_parameter_array, create_derived_type,
	use_iso_fortran_env_module): Likewise.
	* error.c (gfc_diagnostic_starter, gfc_diagnostic_start_span): Use
	pp_verbatim (context->printer, "%s", x) instead of
	pp_verbatim (context->printer, x).
	* match.c (gfc_match_small_int): Adjust gfc_extract_int caller, pass
	1 as new last argument to it, don't emit gfc_error.
	(gfc_match_small_int_expr): Likewise.
	* iresolve.c (gfc_get_string): Optimize format "%s" case.
	(resolve_bound): Use gfc_get_string ("%s", x) instead of
	gfc_get_string (x).
	(resolve_transformational): Formatting fix.
	(gfc_resolve_char_achar): Change name argument to bool is_achar,
	use a single format string and if is_achar add "a" before "char".
	(gfc_resolve_achar, gfc_resolve_char): Adjust callers.
	* expr.c (gfc_extract_int): Change return type to bool, return true
	if some error occurred.  Add REPORT_ERROR argument, if non-zero
	call either gfc_error or gfc_error_now depending on its sign.
	* arith.c (arith_power): Adjust gfc_extract_int caller.
	* symbol.c (gfc_add_component): Use gfc_get_string ("%s", x) instead
	of gfc_get_string (x).
	(gfc_new_symtree, gfc_delete_symtree, gfc_get_uop, gfc_new_symbol,
	gfc_get_gsymbol, generate_isocbinding_symbol): Likewise.
	* openmp.c (gfc_match_omp_clauses): Adjust gfc_extract_int caller, pass
	-1 as new last argument to it, don't emit gfc_error_now.
	(gfc_match_omp_declare_reduction): Use gfc_get_string ("%s", x)
	instead of gfc_get_string (x).
	* check.c (kind_check): Adjust gfc_extract_int caller.
	* intrinsic.c (add_sym, find_sym, make_alias): Use
	gfc_get_string ("%s", x) instead of gfc_get_string (x).
	* simplify.c (get_kind, gfc_simplify_btest, gfc_simplify_maskr,
	gfc_simplify_maskl, gfc_simplify_poppar, gfc_simplify_repeat,
	gfc_simplify_selected_int_kind, gfc_simplify_selected_real_kind):
	Adjust gfc_extract_int callers.
	* trans-decl.c (gfc_find_module): Use gfc_get_string ("%s", x)
	instead of gfc_get_string (x).
	* matchexp.c (expression_syntax): Add const.
	* primary.c (match_kind_param, match_hollerith_constant,
	match_string_constant): Adjust gfc_extract_int callers.
	(match_keyword_arg): Use gfc_get_string ("%s", x) instead of
	gfc_get_string (x).
	* frontend-passes.c (optimize_minmaxloc): Likewise.

From-SVN: r244744
2017-01-21 11:30:54 +01:00