Commit Graph

154867 Commits

Author SHA1 Message Date
Jan Hubicka
4741e46d77 bb-reorder.c (better_edge_p): Fix handling of uninitialized probability.
* bb-reorder.c (better_edge_p): Fix handling of uninitialized
	probability.

From-SVN: r249966
2017-07-04 13:41:21 +00:00
Thomas Preud'homme
e5d811676f Fix ChangeLog format in r247584
This patch fixes relative pathnames in gcc/ChangeLog for r247584.

From-SVN: r249964
2017-07-04 13:19:23 +00:00
Marek Polacek
efbf55b01c re PR c/81231 (ICE with invalid argument to __atomic_*)
PR c/81231
	* c-common.c (sync_resolve_size): Give error for pointers to incomplete
	types.

	* gcc.dg/atomic-pr81231.c: New test.

From-SVN: r249963
2017-07-04 12:17:22 +00:00
Jakub Jelinek
f0622a50ee brig-function.cc: Include profile-count.h.
* brigfrontend/brig-function.cc: Include profile-count.h.
	* brigfrontend/brig-to-generic.cc: Likewise.

From-SVN: r249962
2017-07-04 13:53:50 +02:00
Richard Sandiford
1aad71067c PR 81292: ICE on related strlens after r249880
r249880 installed the result of a strlen in a strinfo if the strinfo
wasn't previously a full string.  But as Jakub says in the PR comments,
we can't just do that in isolation, because there are no vdefs on the
call that would invalidate any related strinfos.

This patch updates the related strinfos if the adjustment is simple and
invalidates them otherwise.  As elsewhere, we treat adjustments of the
form strlen +/- INTEGER_CST as simple but anything else as too complex.

2017-07-04  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	PR tree-optimization/81292
	* tree-ssa-strlen.c (handle_builtin_strlen): When setting
	full_string_p, also call adjust_related_strinfos if the adjustment
	is simple, otherwise invalidate related strinfos.

gcc/testsuite/
	PR tree-optimization/81292
	* gcc.dg/pr81292-1.c: New test.
	* gcc.dg/pr81292-2.c: Likewise.

From-SVN: r249961
2017-07-04 11:48:44 +00:00
Martin Liska
7c819e8ae2 Enable addressable params sanitization with --param asan-stack=1.
2017-07-04  Martin Liska  <mliska@suse.cz>

	PR sanitizer/81040
	* sanopt.c (sanitize_rewrite_addressable_params): Mark the
	newly created variable as DECL_IGNORED_P.
2017-07-04  Martin Liska  <mliska@suse.cz>

	PR sanitizer/81040
	* g++.dg/asan/function-argument-1.C: Run the test-case w/o
	use-after-scope sanitization.

From-SVN: r249960
2017-07-04 10:53:18 +00:00
Martin Liska
6abe28643f Use xstrdup_for_dump in ipa-inline.c (PR ipa/81293).
2017-07-04  Martin Liska  <mliska@suse.cz>

	PR ipa/81293
	* ipa-inline.c (inline_small_functions):
	Use xstrdup_for_dump.

From-SVN: r249959
2017-07-04 10:51:25 +00:00
Tom de Vries
1315099e26 Save and restore EDGE_DFS_BACK in draw_cfg_edges
2017-07-04  Tom de Vries  <tom@codesourcery.com>

	* graph.c (draw_cfg_edges): Save and restore EDGE_DFS_BACK.

From-SVN: r249954
2017-07-04 09:44:00 +00:00
Olivier Hainque
b85a969e83 Add missing libgcc/ChangeLog entry.
From-SVN: r249953
2017-07-04 08:50:03 +00:00
Jakub Jelinek
8e8dd13b35 function-argument-3.C: Add -Wno-psabi to additional options.
* g++.dg/asan/function-argument-3.C: Add -Wno-psabi to additional
	options.

From-SVN: r249952
2017-07-04 10:46:45 +02:00
Jakub Jelinek
f111f4340f re PR target/81175 (EXC_BAD_ACCESS in ::slpeel_duplicate_current_defs_from_edges(edge, edge, edge, edge) at is-a.h:192)
PR target/81175
	* gcc.target/i386/pr69255-2.c (foo): Use the return value of the
	gather.

From-SVN: r249951
2017-07-04 10:44:40 +02:00
Olivier Hainque
88f4e7668c vxworks.h (PTRDIFF_TYPE, SIZE_TYPE): Restore unconditional basic definitions.
2017-07-04  Olivier Hainque  <hainque@adacore.com>

	* config/vxworks.h (PTRDIFF_TYPE, SIZE_TYPE): Restore
	unconditional basic definitions.
	(VXWORKS_LIBS_RTP): Likewise, prefixed by VXWORKS_SYSCALL_LIBS_RTP,
	empty by default.
	* config/i386/vxworks.h (PTRDIFF_TYPE, SIZE_TYPE): Redefine,
	accounting for 64bit ABIs using cpu specific macros available for
	this purpose.
	(VXWORKS_SYSCALL_LIBS_RTP): Likewise.

From-SVN: r249950
2017-07-04 08:41:39 +00:00
Martin Liska
7a1238d110 Add dg-require ifunc for mvc test-cases.
2017-07-04  Martin Liska  <mliska@suse.cz>

	PR ipa/81214
	* g++.dg/ext/mvc2.C: Add dg-require ifunc.
	* g++.dg/ext/mvc3.C: Likewise.
	* gcc.target/i386/mvc2.c: Likewise.
	* gcc.target/i386/mvc3.c: Likewise.

From-SVN: r249949
2017-07-04 07:44:18 +00:00
Jakub Jelinek
8e3b9bbfc8 parser.c (cp_parser_decomposition_declaration): Replace decomposition declaration with structured binding in diagnostics.
* parser.c (cp_parser_decomposition_declaration): Replace
	decomposition declaration with structured binding in diagnostics.
	* decl.c (cp_finish_decomp): Likewise.
	(grokdeclarator): Likewise.

	* g++.dg/cpp1z/decomp1.C: Expect structured binding instead of
	decomposition declaration in diagnostics.
	* g++.dg/cpp1z/decomp2.C: Likewise.
	* g++.dg/cpp1z/decomp3.C: Likewise.
	* g++.dg/cpp1z/decomp4.C: Likewise.
	* g++.dg/cpp1z/decomp5.C: Likewise.
	* g++.dg/cpp1z/decomp6.C: Likewise.
	* g++.dg/cpp1z/decomp7.C: Likewise.
	* g++.dg/cpp1z/decomp8.C: Likewise.
	* g++.dg/cpp1z/decomp13.C: Likewise.
	* g++.dg/cpp1z/decomp14.C: Likewise.
	* g++.dg/cpp1z/decomp18.C: Likewise.
	* g++.dg/cpp1z/decomp19.C: Likewise.
	* g++.dg/cpp1z/decomp22.C: Likewise.
	* g++.dg/cpp1z/decomp23.C: Likewise.
	* g++.dg/cpp1z/decomp24.C: Likewise.
	* g++.dg/cpp1z/decomp25.C: Likewise.
	* g++.dg/cpp1z/decomp26.C: Likewise.
	* g++.dg/cpp1z/decomp28.C: Likewise.

From-SVN: r249948
2017-07-04 09:40:00 +02:00
Jakub Jelinek
9fc1fed43a re PR c++/81258 (ICE on C++1z code with invalid decomposition declaration: in cp_finish_decl, at cp/decl.c:6760)
PR c++/81258
	* parser.c (cp_parser_decomposition_declaration): Diagnose invalid
	forms of structured binding initializers.

	* g++.dg/cpp1z/decomp21.C (foo): Adjust expected diagnostics.
	* g++.dg/cpp1z/decomp30.C: New test.

From-SVN: r249947
2017-07-04 09:38:59 +02:00
Marek Polacek
6c86bd888a * c-warn.c (warn_if_unused_value): Remove WITH_CLEANUP_EXPR handling.
From-SVN: r249943
2017-07-04 06:53:08 +00:00
GCC Administrator
f5474a4c3c Daily bump.
From-SVN: r249942
2017-07-04 00:16:25 +00:00
Olivier Hainque
ca12f1ca1f t-vxworks7: New file.
2017-06-27  Olivier Hainque  <hainque@adacore.com>

	* config/t-vxworks7: New file.

New file mistakenly omitted from previous commit referencing it.

From-SVN: r249938
2017-07-03 20:27:58 +00:00
Paolo Carlini
17c1822101 re PR c++/65775 (Late-specified return type bypasses return type checks (qualified, function, array))
/cp
2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/65775
	* decl.c (grokdeclarator): Move checks on function return type after
	the splice_late_return_type call; if declspecs->locations[ds_type_spec]
	is UNKNOWN_LOCATION fall back to input_location.

/testsuite
2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/65775
	* g++.dg/cpp0x/trailing14.C: New.

From-SVN: r249935
2017-07-03 18:10:52 +00:00
Dominique d'Humieres
370d975d77 re PR fortran/79866 (diagnostics: typo in "Variable %s at %L of type EVENT_TYPE")
2017-07-03  Dominique d'Humieres  <dominiq@lps.ens.fr>
 
	PR fortran/79866
	* resolve.c (resolve_symbol): Fix typo.

	PR testsuite/79866
	* gfortran.dg/coarray_event_2.f08: New test.

From-SVN: r249934
2017-07-03 20:03:51 +02:00
Dominique d'Humieres
73977c4787 re PR fortran/79843 (diagnostics: missing word in fortran/symbol.c, conflict_std)
2017-07-03  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/79843
	* symbol.c (check_conflict): Add missing "conflicts".

	PR testsuite/79843
	* gfortran.dg/namelist_3.f90: Adjust the dg-error string.
	* gfortran.dg/pointer_intent_2.f90: Likewise.

From-SVN: r249933
2017-07-03 19:56:08 +02:00
David Malcolm
4ab42f4628 C++: fix "RT_INTERATION" typo
gcc/cp/ChangeLog:
	* parser.c (enum required_token): Fix spelling of
	RT_INTERATION to RT_ITERATION.
	(cp_parser_iteration_statement): Likewise.
	(cp_parser_required_error): Likewise.

From-SVN: r249931
2017-07-03 17:49:09 +00:00
Dominique d'Humieres
7001cb1ffb re PR bootstrap/81033 (there are cases where ld64 is not able to determine correct atom boundaries from the output GCC currently produces)
2017-07-03  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR target/81033
	* config/darwin.c (darwin_function_switched_text_sections):
	Fix spaces.

From-SVN: r249930
2017-07-03 19:42:54 +02:00
Jan Hubicka
10ea26721d * tree-vect-loop-manip.c (vect_do_peeling): Fix scaling up.
From-SVN: r249929
2017-07-03 17:31:02 +00:00
Richard Earnshaw
5c2ef4e8ed [arm] Add -mbe8 and -mbe32 to options summary.
* doc/invoke.texi (ARM Options): Add -mbe8 and -mbe32 to option summary.

From-SVN: r249928
2017-07-03 16:33:34 +00:00
Richard Sandiford
80be333323 Avoid minimum - 1 confusion in vectoriser
The variables that claimed to be the "minimum number of iterations" for
which vectorisation was profitable were actually the maximum number of
iterations for which vectorisation wasn't profitable.  The loop threshold
was too.

This patch makes the values be what the variable names suggest.

2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-vect-loop.c (vect_analyze_loop_2): Treat min_scalar_loop_bound,
	min_profitable_iters, and th as inclusive lower bounds.
	Fix LOOP_VINFO_PEELING_FOR_GAPS condition.
	(vect_estimate_min_profitable_iters): Return inclusive lower bounds
	for min_profitable_iters and min_profitable_estimate.
	(vect_transform_loop): Treat th as an inclusive lower bound.
	* tree-vect-loop-manip.c (vect_loop_versioning): Likewise.

From-SVN: r249927
2017-07-03 16:30:43 +00:00
Dominique d'Humieres
be58770875 re PR bootstrap/81033 (there are cases where ld64 is not able to determine correct atom boundaries from the output GCC currently produces)
2017-07-03  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR target/81033
	* config/darwin.c (darwin_function_switched_text_sections):
	Replace DECL_NAME with DECL_ASSEMBLER_NAME, split assemble_name_raw
	in two pieces, and suppress the use of buf.

From-SVN: r249926
2017-07-03 17:53:56 +02:00
Nathan Sidwell
57c49199f0 * hash-table.h (hash_table_mod1): Fix indentation.
From-SVN: r249925
2017-07-03 15:06:02 +00:00
Jan Hubicka
2f70a97992 re PR rtl-optimization/81290 (ICE in update_br_prob_note)
PR middle-end/81290
	* predict.c (force_edge_cold): Be more careful about propagation
	backward.
	* profile-count.h (profile_probability::guessed,
	profile_probability::fdo, profile_count::guessed, profile_count::fdo):
	New.
	* tree-ssa-threadupdate.c (recompute_probabilities): Result is guessed.

	* gcc.c-torture/compile/pr81290.c: New.

From-SVN: r249924
2017-07-03 14:40:46 +00:00
James Greenhalgh
d31415ba19 Andrew pointed out that I did not document the new architecture extension flag I added for the RcPc extension.
Andrew pointed out that I did not document the new architecture extension
flag I added for the RcPc extension. This was intentional, as enabling the
rcpc extension does not change GCC code generation, and is just
an assembler flag. But for completeness, here is documentation for the
new option.

gcc/

2017-07-03  James Greenhalgh  <james.greenhalgh@arm.com>

	* doc/invoke.texi (rcpc architecture extension): Document it.

From-SVN: r249923
2017-07-03 14:32:30 +00:00
Nathan Sidwell
d436047768 configure.ac: Set srcdir when sourcing config-lang.in fragments.
* configure.ac: Set srcdir when sourcing config-lang.in fragments.
	* configure: Rebuilt.

	gcc/objcp/
	* config-lang.in: Source cp/config-lang.in, sort objc++ gtfiles list.

From-SVN: r249922
2017-07-03 14:16:59 +00:00
Bernd Schmidt
9dc9ae7437 Readd myself as c6x maintainer.
From-SVN: r249920
2017-07-03 14:01:00 +00:00
Richard Biener
6b5e165bd8 re PR tree-optimization/60510 (SLP blocks loop vectorization (with reduction))
2017-07-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/60510
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Pass in
	the scalar reduction PHI and use it.
	(vectorizable_reduction): Properly guard the single_defuse_cycle
	path for non-SLP reduction chains where we cannot use it.
	Rework reduc_def/index and vector type deduction.  Rework
	vector operand gathering during reduction op code-gen.
	* tree-vect-slp.c (vect_analyze_slp): For failed SLP reduction
	chains dissolve the chain and leave it to non-SLP reduction
	handling.

	* gfortran.dg/vect/pr60510.f: New testcase.

From-SVN: r249919
2017-07-03 13:44:13 +00:00
Tom de Vries
9607b014b2 Fix secure_getenv.h include in plugin-hsa.c
2017-07-03  Tom de Vries  <tom@codesourcery.com>

	* plugin/plugin-hsa.c: Fix secure_getenv.h include.

From-SVN: r249918
2017-07-03 13:40:19 +00:00
Richard Sandiford
25f68d908f Add a helper for getting the overall alignment of a DR
This combines the information from previous patches to give a guaranteed
alignment for the DR as a whole.  This should be a bit safer than using
base_element_aligned, since that only really took the base into account
(not the init or offset).

2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-data-ref.h (dr_alignment): Declare.
	* tree-data-ref.c (dr_alignment): New function.
	* tree-vectorizer.h (dataref_aux): Remove base_element_aligned.
	* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
	set it.
	* tree-vect-stmts.c (vectorizable_store): Use dr_alignment.

From-SVN: r249917
2017-07-03 13:37:07 +00:00
Richard Sandiford
bb64297941 Add DR_BASE_ALIGNMENT and DR_BASE_MISALIGNMENT
This patch records the base alignment and misalignment in
innermost_loop_behavior, to avoid the second-guessing that was
previously done in vect_compute_data_ref_alignment.  It also makes
vect_analyze_data_refs use dr_analyze_innermost, instead of having an
almost-copy of the same code.

I wasn't sure whether the alignments should be measured in bits
(for consistency with most other interfaces) or in bytes (for consistency
with DR_ALIGNED_TO, now DR_OFFSET_ALIGNMENT, and with *_ptr_info_alignment).
I went for bytes because:

- I think in practice most consumers are going to want bytes.
  E.g. using bytes avoids having to mix TYPE_ALIGN and TYPE_ALIGN_UNIT
  in vect_compute_data_ref_alignment.

- It means that any bit-level paranoia is dealt with when building
  the innermost_loop_behavior and doesn't get pushed down to consumers.

2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-data-ref.h (innermost_loop_behavior): Add base_alignment
	and base_misalignment fields.
	(DR_BASE_ALIGNMENT, DR_BASE_MISALIGNMENT): New macros.
	* tree-data-ref.c: Include builtins.h.
	(dr_analyze_innermost): Set up the new innmost_loop_behavior fields.
	* tree-vectorizer.h (STMT_VINFO_DR_BASE_ALIGNMENT): New macro.
	(STMT_VINFO_DR_BASE_MISALIGNMENT): Likewise.
	* tree-vect-data-refs.c: Include tree-cfg.h.
	(vect_compute_data_ref_alignment): Use the new innermost_loop_behavior
	fields instead of calculating an alignment here.
	(vect_analyze_data_refs): Use dr_analyze_innermost.  Dump the new
	innermost_loop_behavior fields.

From-SVN: r249916
2017-07-03 13:36:55 +00:00
Richard Sandiford
832b4117d4 Add DR_STEP_ALIGNMENT
A later patch adds base alignment information to innermost_loop_behavior.
After that, the only remaining piece of alignment information that wasn't
immediately obvious was the step alignment.  Adding that allows a minor
simplification to vect_compute_data_ref_alignment, and also potentially
improves the handling of variable strides for outer loop vectorisation.
A later patch will also use it to give the alignment of the DR as a whole.

2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-data-ref.h (innermost_loop_behavior): Add a step_alignment
	field.
	(DR_STEP_ALIGNMENT): New macro.
	* tree-vectorizer.h (STMT_VINFO_DR_STEP_ALIGNMENT): Likewise.
	* tree-data-ref.c (dr_analyze_innermost): Initalize step_alignment.
	(create_data_ref): Print it.
	* tree-vect-stmts.c (vectorizable_load): Use the step alignment
	to tell whether the step preserves vector (mis)alignment.
	* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Likewise.
	Move the check for an integer step and generalise to all INTEGER_CST.
	(vect_analyze_data_refs): Set DR_STEP_ALIGNMENT when setting DR_STEP.
	Print the outer step alignment.

From-SVN: r249915
2017-07-03 13:36:45 +00:00
Richard Sandiford
e054a1852b Rename DR_ALIGNED_TO to DR_OFFSET_ALIGNMENT
This patch renames DR_ALIGNED_TO to DR_OFFSET_ALIGNMENT, to avoid
confusion with the upcoming DR_BASE_ALIGNMENT.  Nothing needed the
value as a tree, and the value is clipped to BIGGEST_ALIGNMENT
(maybe it should be MAX_OFILE_ALIGNMENT?) so we might as well use
an unsigned int instead.

2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-data-ref.h (innermost_loop_behavior): Replace aligned_to
	with offset_alignment.
	(DR_ALIGNED_TO): Delete.
	(DR_OFFSET_ALIGNMENT): New macro.
	* tree-vectorizer.h (STMT_VINFO_DR_ALIGNED_TO): Delete.
	(STMT_VINFO_DR_OFFSET_ALIGNMENT): New macro.
	* tree-data-ref.c (dr_analyze_innermost): Update after above changes.
	(create_data_ref): Likewise.
	* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Likewise.
	(vect_analyze_data_refs): Likewise.
	* tree-if-conv.c (if_convertible_loop_p_1): Use memset before
	creating dummy innermost behavior.

From-SVN: r249914
2017-07-03 13:36:36 +00:00
Richard Sandiford
abbe3756cd Make dr_analyze_innermost operate on innermost_loop_behavior
This means that callers to dr_analyze_innermost don't need a full
data_reference and don't need to fill in any fields beforehand.

2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-data-ref.h (dr_analyze_innermost): Replace the dr argument
	with a "innermost_loop_behavior *" and refeence tree.
	* tree-data-ref.c (dr_analyze_innermost): Likewise.
	(create_data_ref): Update call accordingly.
	* tree-predcom.c (find_looparound_phi): Likewise.

From-SVN: r249913
2017-07-03 13:36:26 +00:00
Rainer Orth
d8ac7e2840 Require ifunc support in gcc.target/i386/mvc6.c
* gcc.target/i386/mvc6.c: Require ifunc support.

From-SVN: r249912
2017-07-03 13:36:20 +00:00
Richard Sandiford
3f5e8a7690 Use innermost_loop_behavior for outer loop vectorisation
This patch replaces the individual stmt_vinfo dr_* fields with
an innermost_loop_behavior, so that the changes in later patches
get picked up automatically.  It also adds a helper function for
getting the behavior of a data reference wrt the vectorised loop.

2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-vectorizer.h (_stmt_vec_info): Replace individual dr_*
	fields with dr_wrt_vec_loop.
	(STMT_VINFO_DR_BASE_ADDRESS, STMT_VINFO_DR_INIT, STMT_VINFO_DR_OFFSET)
	(STMT_VINFO_DR_STEP, STMT_VINFO_DR_ALIGNED_TO): Update accordingly.
	(STMT_VINFO_DR_WRT_VEC_LOOP): New macro.
	(vect_dr_behavior): New function.
	(vect_create_addr_base_for_vector_ref): Remove loop parameter.
	* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Use
	vect_dr_behavior.  Use a step_preserves_misalignment_p boolean to
	track whether the step preserves the misalignment.
	(vect_create_addr_base_for_vector_ref): Remove loop parameter.
	Use vect_dr_behavior.
	(vect_setup_realignment): Update call accordingly.
	(vect_create_data_ref_ptr): Likewise.  Use vect_dr_behavior.
	* tree-vect-loop-manip.c (vect_gen_prolog_loop_niters): Update
	call to vect_create_addr_base_for_vector_ref.
	(vect_create_cond_for_align_checks): Likewise.
	* tree-vect-patterns.c (vect_recog_bool_pattern): Copy
	STMT_VINFO_DR_WRT_VEC_LOOP as a block.
	(vect_recog_mask_conversion_pattern): Likewise.
	* tree-vect-stmts.c (compare_step_with_zero): Use vect_dr_behavior.
	(new_stmt_vec_info): Remove redundant zeroing.

From-SVN: r249911
2017-07-03 13:36:13 +00:00
Richard Earnshaw
63d03dcecd [arm] Clean up generation of BE8 format images.
The existing code in arm/bpabi.h was quite fragile and relied on matching
specific CPU and/or architecture names.  The introduction of the option
format for -mcpu and -march broke that in a way that would be non-trivial
to fix by updating the list.  The hook in that file was always a pain
as it required every new CPU being added to be add an update here as well
(easy to miss).

I've fixed that problem once and for all by adding a new callback into
the driver to select the correct BE8 behaviour.  This uses features in
the ISA capabilities list to select whether or not to use BE8 format
during linking.

I also noticed that if the user happened to pass both -mbig-endian and
-mlittle-endian on the command line then the linker spec rules would
get somewhat confused and potentially do the wrong thing.  I've fixed that
by marking these options as opposites in the option descriptions.  The
driver will now automatically suppress overridden options leading to the
correct desired behavior.

Whilst fixing this I noticed a couple of anomolus cases in the
existing BE8 support: we were not generating BE8 format for ARMv6 or
ARMv7-R targets.  While the ARMv6 status was probably deliberate at
the time, this is probably not a good idea in the long term as the
alternative, BE32, has been deprecated by ARM.  After discussion with
a couple of colleagues I've decided to change this, but to then add an
option to restore the existing behaviour at the user's option.  So
this patch introduces two new options (opposites) -mbe8 and -mbe32.

This is a quiet behavior change, so I'll add a comment to the release
notes shortly.

	* common/config/arm/arm-common.c (arm_be8_option): New function.
	* config/arm/arm-isa.h (isa_feature): Add new feature bit isa_bit_be8.
	(ISA_ARMv6): Add isa_bit_be8.
	* config/arm/arm.h (arm_be8_option): Add prototype.
	(BE8_SPEC_FUNCTION): New define.
	(EXTRA_SPEC_FUNCTIONS): Add BE8_SPEC_FUNCTION.
	* config/arm/arm.opt (mbig-endian): Mark as Negative of mlittle-endian.
	(mlittle-endian): Similarly.
	(mbe8, mbe32): New options.
	* config/arm/bpabi.h (BE8_LINK_SPEC): Call arm_be8_option.
	* doc/invoke.texi (ARM Options): Document -mbe8 and -mbe32.

From-SVN: r249909
2017-07-03 13:22:05 +00:00
Jan Hubicka
e1a921ddaa * tree-cfg.c (gimple_find_sub_bbs): Fix profile updating.
From-SVN: r249908
2017-07-03 12:43:19 +00:00
Jan Hubicka
b5db8b44e5 tree-cfgcleanup.c (want_merge_blocks_p): New function.
* tree-cfgcleanup.c (want_merge_blocks_p): New function.
        (cleanup_tree_cfg_bb): Use it.
	* profile-count.h (profile_count::of_for_merging, profile_count::merge):
	New functions.
	* tree-cfg.c (gimple_merge_blocks): Use profile_count::merge.

From-SVN: r249907
2017-07-03 12:42:07 +00:00
Jan Hubicka
edfe99a43c re PR target/81285 (r249888 breaks bootstrap on ppc64le)
PR bootstrap/81285
	* loop-doloop.c (add_test): Update profile.

From-SVN: r249904
2017-07-03 12:17:59 +00:00
Martin Liska
da4029679e ASAN: handle addressable params (PR sanitize/81040).
2017-07-03  Martin Liska  <mliska@suse.cz>

	PR sanitize/81040
	* g++.dg/asan/function-argument-1.C: New test.
	* g++.dg/asan/function-argument-2.C: New test.
	* g++.dg/asan/function-argument-3.C: New test.
2017-07-03  Martin Liska  <mliska@suse.cz>

	PR sanitize/81040
	* sanopt.c (rewrite_usage_of_param): New function.
	(sanitize_rewrite_addressable_params): Likewise.
	(pass_sanopt::execute): Call rewrite_usage_of_param.

From-SVN: r249903
2017-07-03 11:48:47 +00:00
Richard Biener
b6d447f209 tree-vect-loop.c (vect_create_epilog_for_reduction): Revert back to using VIEW_CONVERT_EXPR.
2017-07-03  Richard Biener  <rguenther@suse.de>

	* tree-vect-loop.c (vect_create_epilog_for_reduction): Revert
	back to using VIEW_CONVERT_EXPR.

From-SVN: r249902
2017-07-03 09:42:22 +00:00
Martin Liska
7b97253879 Make stack epilogue more efficient
2017-07-03  Martin Liska  <mliska@suse.cz>

	* asan.c (asan_emit_stack_protection): Unpoison just red zones
	and shadow memory of auto variables which are subject of
	use-after-scope sanitization.
	(asan_expand_mark_ifn): Add do set only when is_poison.

From-SVN: r249900
2017-07-03 09:26:31 +00:00
Richard Biener
c78e36522d tree-vect-loop.c (vect_analyze_loop_operations): Also analyze reduction PHIs.
2016-07-03  Richard Biener  <rguenther@suse.de>

	* tree-vect-loop.c (vect_analyze_loop_operations): Also analyze
	reduction PHIs.
	(vect_force_simple_reduction): Record reduction def -> phi mapping.
	(vectorizable_reduction): Perform reduction PHI creation when
	visiting a reduction PHI and adjust and simplify code generation
	phase of the reduction op.  Cache dts, use fold_binary, not fold_build2.
	(vect_transform_loop): Visit reduction PHIs.
	* tree-vect-slp.c (vect_get_and_check_slp_defs): Record reduction
	defs into the SLP tree.
	(vect_build_slp_tree): Reduction defs terminate the recursion.
	* tree-vect-stmts.c (vect_get_vec_def_for_operand_1): Allow lookup
	of reduction defs.
	(vect_get_vec_defs_for_stmt_copy): Export.
	(vect_get_vec_defs): Likewise.
	* tree-vectorizer.h (struct _stmt_vec_info): Amend reduc_def
	purpose.
	(vect_get_vec_defs_for_stmt_copy): Declare.
	(vect_get_vec_defs): Likewise.

From-SVN: r249897
2017-07-03 07:28:28 +00:00
Richard Sandiford
bc9f4235bc Tweak BB analysis for dr_analyze_innermost
dr_analyze_innermost had a "struct loop *nest" parameter that acted
like a boolean.  This was added in r179161, with the idea that a
null nest selected BB-level analysis rather than loop analysis.

The handling seemed strange though.  If the DR was part of a loop,
we still tried to express the base and offset values as IVs, potentially
giving a nonzero step.  If that failed for any reason, we'd revert to
using the original base and offset, just as we would if we hadn't asked
for an IV in the first place.

It seems more natural to use the !in_loop handling whenever nest is null
and always set the step to zero.  This actually enables one more SLP
opportunity in bb-slp-pr65935.c.

I checked out r179161 and tried the patch there.  The test case added
in that revision still passes, so I don't think there was any particular
need to check simple_iv.

2017-06-28  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-data-ref.c (dr_analyze_innermost): Replace the "nest"
	parameter with a "loop" parameter and use it instead of the
	loop containing DR_STMT.  Don't check simple_iv when doing
	BB analysis.  Describe the two analysis modes in the comment.

gcc/testsuite/
	* gcc.dg/vect/bb-slp-pr65935.c: Expect SLP to be used in main
	as well.

From-SVN: r249896
2017-07-03 07:26:21 +00:00