Commit Graph

154708 Commits

Author SHA1 Message Date
Jan Kratochvil ef29f5dd77 include/ChangeLog
2017-07-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

        * dwarf2.def (DW_IDX_compile_unit, DW_IDX_type_unit, DW_IDX_die_offset)
        (DW_IDX_parent, DW_IDX_type_hash, DW_IDX_lo_user, DW_IDX_hi_user)
        (DW_IDX_GNU_internal, DW_IDX_GNU_external): New.
        * dwarf2.h (DW_IDX, DW_IDX_DUP, DW_FIRST_IDX, DW_END_IDX): New.
        (enum dwarf_name_index_attribute): Remove.
        (get_DW_IDX_name): New declaration.

libiberty/ChangeLog
2017-07-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

        * dwarfnames.c (DW_FIRST_IDX, DW_END_IDX, DW_IDX, DW_IDX_DUP): New.

From-SVN: r249883
2017-07-02 20:00:48 +00:00
Thomas Koenig b677e2f67f eoshift0.c: For contiguous arrays, use block algorithm.
2017-07-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* intrinsics/eoshift0.c:  For contiguous arrays, use
	block algorithm.  Use memcpy where possible.

2017-07-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* gfortran/eoshift_3.f90:  New test.

From-SVN: r249882
2017-07-02 12:34:52 +00:00
Richard Sandiford b0e84cf75a Reorganise machmode.h headers
This patch splits the auto-generated inline functions out of
insn-modes.h and puts them in a new header file, insn-modes-inline.h.
It also makes coretypes.h include these files directly, rather than
indirectly via machmode.h.  This in turn allows insn-modes-inline.h
and machmode.h to come later in the include list, after wide-int.h.
This is useful for later patches.

insn-modes.h itself still needs to come first, since it provides
configuration information like MAX_BITSIZE_MODE_ANY_INT, which is
used to control the size of a wide_int.

The patch also makes the generator files include machmode.h
via coretypes.h.  Previously they did it by more indirect means.

Finally, the patch makes wide-int-print.h available via coretypes.h
too.  There didn't seem to be any reason to force only the print
routines to be included directly, and it would be painful to extend
that approach to the SVE patches.


[Based on the code ARM contributed in branches/ARM/sve-branch@242100]

2017-07-02  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

contrib/header-tools/
	* graph-header-logs (ignore): Update coretypes.h header list.

gcc/
	* Makefile.in (MACHMODE_H): Remove insn-modes.h
	(CORETYPES_H): New define.
	(MOSTLYCLEANFILES): Add insn-modes-inline.h.
	(insn-modes-inline.h, s-modes-inline-h): New rules.
	(generated_files): Add insn-modes-inline.h.
	(RTL_BASE_H, TREE_CORE_H): Use CORETYPES_H instead of coretypes.h.
	(build/gensupport.o, build/ggc-none.o, build/print-rtl.o): Likewise.
	(build/read-md.o, build/read-rtl.o, build/rtl.o): Likewise.
	(build/vec.o, build/hash-table.o, build/inchash.o): Likewise.
	(build/gencondmd.o, build/genattr.o, build/genattr-common.o): Likewise.
	(build/genattrtab.o, build/genautomata.o, build/gencheck.o): Likewise.
	(build/gencodes.o, build/genconditions.o): Likewise.
	(build/genconfig.o, build/genconstants.o, build/genemit.o): Likewise.
	(build/genenums.o, build/genextract.o, build/genflags.o): Likewise.
	(build/gentarget-def.o, build/genmddeps.o, build/genopinit.o)
	(build/genoutput.o, build/genpeep.o, build/genpreds.o): Likewise.
	(build/genrecog.o, build/genmddump.o, build/genmatch.o): Likewise.
	(build/gencfn-macros.o, build/gcov-iov.o): Likewise.
	* coretypes.h: Include everything up to real.h for generators.
	Include insn-modes.h first.  Include wide-int-print.h after
	wide-int.h.  Include insn-modes-inline.h and then machmode.h.
	* machmode.h: Don't include insn-modes.h here.
	* function-tests.c: Remove includes of signop.h, machmode.h,
	double-int.h and wide-int.h.
	* rtl.h: Likewise.
	* gcc-rich-location.c: Remove includes of machmode.h, double-int.h
	and wide-int.h.
	* optc-save-gen.awk: Likewise.
	* gencheck.c (BITS_PER_UNIT): Delete dummy definition.
	* godump.c: Remove include of wide-int-print.h.
	* pretty-print.h: Likewise.
	* wide-int-print.cc: Likewise.
	* wide-int.cc: Likewise.
	* hash-map-tests.c: Remove include of signop.h.
	* hash-set-tests.c: Likewise.
	* rtl-tests.c: Likewise.
	* mkconfig.sh: Remove include of machmode.h.
	* genmodes.c (emit_insn_modes_h): Split emission of inline functions
	into...
	(emit_insn_modes_inline_h): ...this new function.  Emit the code
	into an insn-modes-inline.h header file, adding appropriate
	include guards and end comments.
	(emit_insn_modes_c_header): Remove include of machmode.h.
	(emit_min_insn_modes_c_header): Include coretypes.h rather than
	machmode.h.
	(main): Handle -i flag and call emit_insn_modes_inline_h when
	it is passed.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r249881
2017-07-02 09:06:10 +00:00
Richard Sandiford e3f9a279f5 Make tree-ssa-strlen.c handle partial unterminated strings
tree-ssa-strlen.c looks for cases in which a string is built up using
operations like:

    memcpy (a, "foo", 4);
    memcpy (a + 3, "bar", 4);
    int x = strlen (a);

As a side-effect, it optimises the non-final memcpys so that they don't
include the nul terminator.

However, after removing some "& ~0x1"s from tree-ssa-dse.c, the DSE pass
does this optimisation itself (because it can tell that later memcpys
overwrite the terminators).  The strlen pass wasn't able to handle these
pre-optimised calls in the same way as the unoptimised ones.

This patch adds support for tracking unterminated strings.

[Based on the code ARM contributed in branches/ARM/sve-branch@246236]

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

gcc/
	* tree-ssa-strlen.c (strinfo): Rename the length field to
	nonzero_chars.  Add a full_string_p field.
	(compare_nonzero_chars, zero_length_string_p): New functions.
	(get_addr_stridx): Add an offset_out parameter.
	Use compare_nonzero_chars.
	(get_stridx): Update accordingly.  Use compare_nonzero_chars.
	(new_strinfo): Update after above changes to strinfo.
	(set_endptr_and_length): Set full_string_p.
	(get_string_length): Update after above changes to strinfo.
	(unshare_strinfo): Update call to new_strinfo.
	(maybe_invalidate): Likewise.
	(get_stridx_plus_constant): Change off to unsigned HOST_WIDE_INT.
	Use compare_nonzero_chars and zero_string_p.  Treat nonzero_chars
	as a uhwi instead of an shwi.  Update after above changes to
	strinfo and new_strinfo.
	(zero_length_string): Assert that chainsi contains full strings.
	Use zero_length_string_p.  Update call to new_strinfo.
	(adjust_related_strinfos): Update after above changes to strinfo.
	Copy full_string_p from origsi.
	(adjust_last_stmt): Use zero_length_string_p.
	(handle_builtin_strlen): Update after above changes to strinfo and
	new_strinfo.  Install the lhs as the string length if the previous
	entry didn't describe a full string.
	(handle_builtin_strchr): Update after above changes to strinfo
	and new_strinfo.
	(handle_builtin_strcpy): Likewise.
	(handle_builtin_strcat): Likewise.
	(handle_builtin_malloc): Likewise.
	(handle_pointer_plus): Likewise.
	(handle_builtin_memcpy): Likewise.  Track nonzero characters
	that aren't necessarily followed by a nul terminator.
	(handle_char_store): Likewise.

gcc/testsuite/
	* gcc.dg/strlenopt-32.c: New testcase.
	* gcc.dg/strlenopt-33.c: Likewise.
	* gcc.dg/strlenopt-33g.c: Likewise.
	* gcc.dg/strlenopt-34.c: Likewise.
	* gcc.dg/strlenopt-35.c: Likewise.

From-SVN: r249880
2017-07-02 08:52:42 +00:00
Richard Sandiford 862088aa63 PR 80769: Incorrect strlen optimisation
In this testcase, we (correctly) record after:

  strcpy (p1, "abcde");
  char *p2 = strchr (p1, '\0');
  strcpy (p2, q);

that the length of p1 and p2 can be calculated by converting the
second strcpy to:

  tmp = stpcpy (p2, q)

and then doing tmp - p1 for p1 and tmp - p2 for p2.  This is delayed
until we know whether we actually need it.  Then:

  char *p3 = strchr (p2, '\0');

forces us to calculate the length of p2 in this way.  At this point
we had three related strinfos:

  p1: delayed length, calculated from tmp = stpcpy (p2, q)
  p2: known length, tmp - p2
  p3: known length, 0

After:

  memcpy (p3, "x", 2);

we use adjust_related_strinfos to add 1 to each length.  However,
that didn't do anything for delayed lengths because:

	  else if (si->stmt != NULL)
	    /* Delayed length computation is unaffected.  */
	    ;

So after the memcpy we had:

  p1: delayed length, calculated from tmp = stpcpy (p2, q)
  p2: known length, tmp - p2 + 1
  p3: known length, 1

where the length of p1 was no longer correct.

2017-05-16  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	PR tree-optimization/80769
	* tree-ssa-strlen.c (strinfo): Document that "stmt" is also used
	for malloc and calloc.  Document the new invariant that all related
	strinfos have delayed lengths or none do.
	(verify_related_strinfos): Move earlier in file.
	(set_endptr_and_length): New function, split out from...
	(get_string_length): ...here.  Also set the lengths of related
	strinfos.
	(zero_length_string): Assert that chainsi has known (rather than
	delayed) lengths.
	(adjust_related_strinfos): Likewise.

gcc/testsuite/
	PR tree-optimization/80769
	* gcc.dg/strlenopt-31.c: New test.
	* gcc.dg/strlenopt-31g.c: Likewise.

From-SVN: r249879
2017-07-02 08:43:11 +00:00
Richard Sandiford c34d09274e PR81136: ICE from inconsistent DR_MISALIGNMENTs
The test case triggered this assert in vect_update_misalignment_for_peel:

      gcc_assert (DR_MISALIGNMENT (dr) / dr_size ==
                  DR_MISALIGNMENT (dr_peel) / dr_peel_size);

The problem was that:

- one memory reference guaranteed a high base alignment, when considering
  that reference in isolation.  This meant that we could calculate the
  vector misalignment for its DR at compile time.

- the other memory reference only guaranteed a low base alignment,
  when considering that reference in isolation.  We therefore couldn't
  calculate the vector misalignment for its DR at compile time.

- when looking at the values of the two addresses as a pair (rather
  than the memory references), it was obvious that they had the same
  misalignment, whatever that misalignment happened to be.

This is working as designed, so the patch restricts the assert to cases
in which both addresses have a compile-time misalignment.

In the test case this looks like a missed opportunity.  Both references
are unconditional, so it should be possible to use the highest of the
available base alignment guarantees when analyzing each reference.
A later patch does this, but the problem would still remain for
conditional references.

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

gcc/
	PR tree-optimization/81136
	* tree-vect-data-refs.c (vect_update_misalignment_for_peel): Only
	assert that two references with the same misalignment have the same
	compile-time misalignment if those compile-time misalignments
	are known.

gcc/testsuite/
	PR tree-optimization/81136
	* gcc.dg/vect/pr81136.c: New test.

From-SVN: r249878
2017-07-02 08:37:07 +00:00
Andi Kleen 86ae8a3d66 Always print attributes when dumping tree
A tree type dump currently doesn't print the attributes. Since we have
so many now and they do many interesting things dumping them can be
useful. So dump them by default for tree type dumps.

gcc/:

2017-07-01  Andi Kleen  <ak@linux.intel.com>

        * print-tree.c (print_node): Print all attributes.

From-SVN: r249877
2017-07-02 00:18:37 +00:00
GCC Administrator 01be4b2d15 Daily bump.
From-SVN: r249876
2017-07-02 00:16:34 +00:00
Jan Hubicka af2bbc51d3 cfg.c (scale_bbs_frequencies): New function.
* cfg.c (scale_bbs_frequencies): New function.
	* cfg.h (scale_bbs_frequencies): Declare it.
	* cfgloopanal.c (single_likely_exit): Cleanup.
	* cfgloopmanip.c (scale_loop_frequencies): Take profile_probability
	as parameter.
	(scale_loop_profile): Likewise.
	(loop_version): Likewise.
	(create_empty_loop_on_edge): Update.
	* cfgloopmanip.h (scale_loop_frequencies, scale_loop_profile,
	scale_loop_frequencies, scale_loop_profile, loopify,
	loop_version): Update prototypes.
	* modulo-sched.c (sms_schedule): Update.
	* predict.c (unlikely_executed_edge_p): Also check probability.
	(probably_never_executed_edge_p): Fix typo.
	* tree-if-conv.c (version_loop_for_if_conversion): Update.
	* tree-parloops.c (gen_parallel_loop): Update.
	* tree-ssa-loop-ivcanon.c (try_peel_loop): Update.
	* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Update.
	* tree-ssa-loop-split.c (split_loop): Update.
	* tree-ssa-loop-unswitch.c (tree_unswitch_loop): Update.
	* tree-vect-loop-manip.c (vect_do_peeling): Update.
	(vect_loop_versioning): Update.
	* tree-vect-loop.c (scale_profile_for_vect_loop): Update.

From-SVN: r249872
2017-07-01 20:46:40 +00:00
Jan Hubicka e39df5466d * trans-mem.c (split_bb_make_tm_edge): Update profile.
From-SVN: r249871
2017-07-01 14:56:21 +00:00
Jan Hubicka 1099198d00 tree-if-conv.c (combine_blocks): Use make_single_succ_edge to keep profile consistent.
* tree-if-conv.c (combine_blocks): Use make_single_succ_edge
	to keep profile consistent.

From-SVN: r249870
2017-07-01 14:55:28 +00:00
Jan Hubicka 36d95aa891 cfgrtl.c (rtl_flow_call_edges_add): Update profile.
* cfgrtl.c (rtl_flow_call_edges_add): Update profile.
	* tree-cfg.c (gimple_flow_call_edges_add): Likewise.
	* profile-count.h (max_safe_multiplier): Make unsigned.
	(profile_count::guessed_zero): New.

From-SVN: r249869
2017-07-01 12:31:25 +00:00
Jan Hubicka a4f20288d8 bb-reorder.c (fix_up_crossing_landing_pad, [...]): Use make_single_succ_edge to keep profile consistent.
* bb-reorder.c (fix_up_crossing_landing_pad,
	fix_crossing_conditional_branches): Use make_single_succ_edge
	to keep profile consistent.

From-SVN: r249868
2017-07-01 12:29:55 +00:00
Jan Hubicka c7be78e9b3 tree-vect-loop.c (optimize_mask_stores): Use make_single_succ_edge to update profile.
* tree-vect-loop.c (optimize_mask_stores): Use make_single_succ_edge
	to update profile.

From-SVN: r249867
2017-07-01 12:05:29 +00:00
Jakub Jelinek 946ddcdf15 re PR sanitizer/81262 (verify_flow_info failed for asmgoto test-case with -fsanitize=undefined)
PR sanitizer/81262
	* bb-reorder.c (fix_up_fall_thru_edges): Move variable declarations to
	the right scopes, make sure cond_jump isn't preserved between multiple
	iterations.  Search for fallthru edge whenever there are 3+ edges and
	use find_fallthru_edge for it.

From-SVN: r249866
2017-07-01 12:11:16 +02:00
Jakub Jelinek c52d6043af re PR sanitizer/81262 (verify_flow_info failed for asmgoto test-case with -fsanitize=undefined)
PR sanitizer/81262
	* bb-reorder.c (fix_up_fall_thru_edges): Move variable declarations to
	the right scopes, make sure cond_jump isn't preserved between multiple
	iterations.  Search for fallthru edge whenever there are 3+ edges and
	use find_fallthru_edge for it.

	* gcc.c-torture/compile/pr81262.c: New test.
	* g++.dg/ubsan/pr81262.C: New test.

From-SVN: r249865
2017-07-01 10:16:27 +02:00
Jan Hubicka 9aad8d9385 Patch by Alexander Monakov <amonakov@ispras.ru>
Patch by Alexander Monakov <amonakov@ispras.ru>
	* sel-sched-ir.c (compute_succs_info): Handle uninitialized
	probabilities consistently.

From-SVN: r249864
2017-07-01 07:47:22 +00:00
Jan Hubicka 3904572bee sel-sched-ir.c (compute_succs_info): Handle uninitialized probabilities consistently.
* sel-sched-ir.c (compute_succs_info): Handle uninitialized
	probabilities consistently.

From-SVN: r249863
2017-07-01 07:44:45 +00:00
Jan Hubicka c0c46dc677 pa.c (pa_expand_compare_and_swap_loop): Update call of emit_cmp_and_jump_insns.
* pa.c (pa_expand_compare_and_swap_loop): Update call of
	emit_cmp_and_jump_insns.

From-SVN: r249862
2017-07-01 07:28:27 +00:00
GCC Administrator 5a6509770b Daily bump.
From-SVN: r249861
2017-07-01 00:16:33 +00:00
Jan Hubicka 77616c7e1d re PR ipa/81261 (ICE with -fno-guess-branch-probability)
PR ipa/81261
	* tree-inline.c (expand_call_inline): Combine profile statuses.

From-SVN: r249856
2017-06-30 21:09:13 +00:00
Jason Merrill 3d4de231f7 PR c++/81257 - ICE with invalid ::template.
PR c++/54769 - wrong lookup of dependent template-name.
	* parser.c (cp_parser_template_name): Revert part of last change.

From-SVN: r249855
2017-06-30 17:08:53 -04:00
Andrew Pinski fb6a764dfd tree-if-conv.c (predicate_scalar_phi): Update new_stmt if fold_stmt returned true.
2017-06-30  Andrew Pinski  <apinski@cavium.com>

        * tree-if-conv.c (predicate_scalar_phi): Update new_stmt if
        fold_stmt returned true.
2017-06-30  Andrew Pinski  <apinski@cavium.com>

        * gcc.dg/torture/pr81245.c: New testcase.

From-SVN: r249854
2017-06-30 13:40:38 -07:00
Nathan Sidwell 08fb13163c config-lang.in (gtfiles): Add cp/lex.c.
* config-lang.in (gtfiles): Add cp/lex.c.
	* cp-tree.h (mangle_convop_name_for_type): Rename ...
	(make_conv_op_name): ... here.  Move to lex.
	* lambda.c (maybe_add_lambda_conv_op): Update.
	* parser.c (cp_parser_conversion_function_id): Update.
	* pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
	tsubst_copy_and_build): Update.
	* semantics.c (apply_deduced_return_type): Update.
	* mangle.c (conv_type_hasher, conv_type_names,
	mangle_conv_op_name_for_type): Move to ...
	* lex.c (conv_type_hasher, conv_type_names, make_convop_name):
	... here.  Rename.

	* libcp1plugin.cc (plugin_build_decl): Use make_conv_op_name.
	(plugin_build_dependent_expr): Likewise.

From-SVN: r249852
2017-06-30 18:46:01 +00:00
Nathan Sidwell 618400bc14 ggc.h (empty_string): Delete.
* ggc.h (empty_string): Delete.
	* cfgexpand.c (expand_asm_stmt): Use plain "".
	* optabs.c (expand_asm_memory_barrier): Likewise.
	* stringpool.c (empty_string): Delete.
	(digit_vector, digit_string): Delete.
	(ggc_alloc_string): Use plain "", don't optimize single digit
	strings.  Use ggc_alloc_atomic.

From-SVN: r249851
2017-06-30 17:00:46 +00:00
Richard Earnshaw 84682fd249 [rtlanal] Do a better job of costing parallel sets containing flag-setting operations.
Many parallel set insns are of the form of a single set that also sets
the condition code flags.  In this case the cost of such an insn is
normally the cost of the part that doesn't set the flags, since
updating the condition flags is simply a side effect.

At present all such insns are treated as having unknown cost (ie 0)
and combine assumes that such insns are infinitely more expensive than
any other insn sequence with a non-zero cost.

This patch addresses this problem by allowing insn_rtx_cost to ignore
the condition setting part of a PARALLEL iff there is exactly one
comparison set and one non-comparison set.  If the only set operation
is a comparison we still use that as the basis of the insn cost.

	* rtlanal.c (insn_rtx_cost): If a parallel contains exactly one
	comparison set and one other set, use the cost of the non-comparison
	set.

Bootstrapped on aarch64-none-linuxgnu

From-SVN: r249850
2017-06-30 16:36:57 +00:00
Nathan Sidwell e886224be7 ggc.h: Replace all 'static inline' with plain 'inline'.
* ggc.h: Replace all 'static inline' with plain 'inline'.  Fix
	some formatting.

From-SVN: r249848
2017-06-30 16:10:13 +00:00
Peter Bergner 39426ab74f tree-cfg.c (group_case_labels_stmt): Merge scanning and compressing loops.
* tree-cfg.c (group_case_labels_stmt): Merge scanning and compressing
	loops.  Remove now unneeded calls to gimple_switch_set_label() that
	just set removed labels to NULL_TREE.

From-SVN: r249847
2017-06-30 11:04:08 -05:00
Aldy Hernandez 059ab14914 tree-ssanames.c (set_range_info_raw): Abstract from ...
* tree-ssanames.c (set_range_info_raw): Abstract from ...
	(set_range_info): ...here.  Only call set_range_info_raw if domain
	is useful.
	(set_nonzero_bits): Call set_range_info_raw.
	* tree-ssanames.h (set_range_info_raw): New.
testsuite/
	* gcc.dg/Walloca-14.c: Adapt test to recognize new complaint of
	unbounded use.

From-SVN: r249846
2017-06-30 15:36:41 +00:00
David Malcolm e59e8b5a1c Fix location of typeid() (PR c++/80014)
gcc/cp/ChangeLog:
	PR c++/80014
	* parser.c (cp_parser_postfix_expression): Construct a location
	for typeid expressions.

gcc/testsuite/ChangeLog:
	PR c++/80014
	* g++.dg/plugin/diagnostic-test-expressions-1.C (std::type_info):
	Add declaration.
	(test_typeid): New test function.

From-SVN: r249845
2017-06-30 15:20:55 +00:00
Jakub Jelinek e855bdc04d re PR target/81225 (ICE with -mavx512ifma -O3 -ffloat-store)
PR target/81225
	* config/i386/sse.md (vec_extract_lo_<mode><mask_name>): For
	V8FI, V16FI and VI8F_256 iterators, use <store_mask_predicate> instead
	of nonimmediate_operand and <store_mask_constraint> instead of m for
	the input operand.  For V8FI iterator, always split if input is a MEM.
	For V16FI and V8SF_256 iterators, don't test if both operands are MEM
	if <mask_applied>.  For VI4F_256 iterator, use <store_mask_predicate>
	instead of register_operand and <store_mask_constraint> instead of v for
        the input operand.  Make sure both operands aren't MEMs for if not
	<mask_applied>.

	* gcc.target/i386/pr81225.c: New test.

From-SVN: r249844
2017-06-30 16:52:24 +02:00
Nathan Sidwell fe32bb1b5b cp-tree.h (lookup_fnfields_1, [...]): Don't declare.
* cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
	declare.
	(lookup_all_conversions): Declare.
	* class.c (get_basefndecls): Use lookup_fnfields_slot.
	* decl.c (register_dtor_fn): Use lookup_fnfields_slot.
	* decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
	diagnostics.
	* pt.c (retrieve_specialization): Use lookup_fnfields_slot.
	(check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
	lookup_all_conversions.
	* search.c (lookup_fnfields_1): Make static.
	(lookup_all_conversions): New.
	(class_method_index_for_fn): Delete.
	* semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
	lookup_fnfields_slot.

	* g++.dg/concepts/memfun-err.C: Adjust diagnostics.
	* g++.dg/cpp0x/decltype9.C: Likewise.
	* g++.dg/cpp0x/forw_enum9.C: Likewise.
	* g++.dg/lookup/decl1.C: Likewise.
	* g++.dg/lookup/extern-c-redecl.C: Likewise.
	* g++.dg/other/pr28432.C: Likewise.
	* g++.dg/parse/crash12.C: Likewise.
	* g++.dg/parse/enum3.C: Likewise.
	* g++.dg/parse/operator6.C: Likewise.
	* g++.dg/template/crash69.C: Likewise.
	* g++.dg/template/error27.C: Likewise.
	* g++.dg/template/error28.C: Likewise.
	* g++.dg/template/memfriend6.C: Likewise.
	* g++.old-deja/g++.mike/err1.C: Likewise.
	* g++.old-deja/g++.mike/p811.C: Likewise.
	* g++.old-deja/g++.other/crash25.C: Likewise.
	* g++.old-deja/g++.other/dtor4.C: Likewise.
	* g++.old-deja/g++.pt/t37.C: Likewise.

From-SVN: r249843
2017-06-30 14:50:48 +00:00
Sylvestre Ledru 367e91e1c5 * lto-wrapper.c (copy_file) Close both file descriptors before
exiting normally.

From-SVN: r249841
2017-06-30 14:17:54 +00:00
Martin Liska aaa587d46d Fix removal of ifunc (PR ipa/81214).
2017-06-30  Martin Liska  <mliska@suse.cz>

	PR ipa/81214
	* gcc.target/i386/pr81214.c: New test.
2017-06-30  Martin Liska  <mliska@suse.cz>

	PR ipa/81214
	* multiple_target.c (create_dispatcher_calls): Make ifunc
	also for function that don't have calls or are not referenced.

From-SVN: r249840
2017-06-30 13:51:19 +00:00
Richard Biener bd2f172f0b tree-vect-slp.c (vect_slp_analyze_node_operations): Only analyze the first scalar stmt.
2017-06-30  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_slp_analyze_node_operations): Only
	analyze the first scalar stmt.  Move vector type computation
	for the BB case here from ...
	* tree-vect-stmts.c (vect_analyze_stmt): ... here.  Guard
	live operation processing in the SLP case properly.

From-SVN: r249839
2017-06-30 13:19:29 +00:00
Nathan Sidwell 3b5c768c40 call.c (build_new_method_call_1): Use constructo_name to get ctor name.
* call.c (build_new_method_call_1): Use constructo_name to get
	ctor name.  Move argument processing earlier to merge cdtor
	handling blocks.
	* decl.c (grokfndecl): Cdtors have special names.
	* method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
	* pt.c (check_explicit_specialization): Cdtor name is already
	special.
	* search.c (class_method_index_for_fn): Likewise.

	* g++.dg/plugin/decl-plugin-test.C: Expect special ctor name.

From-SVN: r249838
2017-06-30 13:11:01 +00:00
Nathan Sidwell 274c15162b re PR c++/81229 (ICE in c_tree_chain_next on aarch64)
PR c++/81229
	* name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
	a matching TYPE_DECL.

	* g++.dg/lookup/pr81229.C: New.

From-SVN: r249835
2017-06-30 11:40:08 +00:00
Richard Biener 273a94e0fa graph.c (draw_cfg_node_succ_edges): Fix broken dot syntax.
2017-06-30  Richard Biener  <rguenther@suse.de>

	* graph.c (draw_cfg_node_succ_edges): Fix broken dot syntax.

From-SVN: r249834
2017-06-30 09:49:44 +00:00
Martin Liska c497284c37 Call BUILT_IN_ASAN_HANDLE_NO_RETURN before BUILT_IN_UNWIND_RESUME (PR sanitizer/81021).
2017-06-30  Martin Liska  <mliska@suse.cz>

	PR sanitizer/81021
	* g++.dg/asan/pr81021.C: New test.
2017-06-30  Martin Liska  <mliska@suse.cz>

	PR sanitizer/81021
	* tree-eh.c (lower_resx): Call BUILT_IN_ASAN_HANDLE_NO_RETURN
	before BUILT_IN_UNWIND_RESUME when ASAN is used.

From-SVN: r249833
2017-06-30 08:51:00 +00:00
Yvan Roux 516fa89464 Documentation: Clean up AArch64 options.
gcc/
	2017-06-30  Yvan Roux  <yvan.roux@linaro.org>

	* doc/invoke.texi (AArch64): Add missing options and remove redundant
	ones.

From-SVN: r249832
2017-06-30 08:36:57 +00:00
Richard Biener 4812f0b73c re PR tree-optimization/81249 (ICE: error: incompatible types in PHI argument 0)
2017-06-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/81249
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Convert
	condition reduction result to original scalar type.

	* g++.dg/torture/pr81249.C: New testcase.

From-SVN: r249831
2017-06-30 08:08:33 +00:00
Andreas Krebbel 5ef4d61d2b profile-count.h: Fix typos and whitespace issues.
gcc/ChangeLog:

2017-06-30  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* profile-count.h (enum profile_quality): Fix typos and whitespace
	issues.

From-SVN: r249830
2017-06-30 06:46:42 +00:00
Andreas Krebbel 8f746f8c89 S/390: Adjust to the recent branch probability changes.
This fixes the bootstrap failure triggered by the recent changes wrt
branch probabilities aka emit_cmp_and_jump_insns does not accept
integers as branch probability anymore.

gcc/ChangeLog:

2017-06-30  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_expand_setmem): Adjust to the new data
	type for branch probabilities.

From-SVN: r249829
2017-06-30 06:45:51 +00:00
Julian Brown 00c7c57f0d aarch64-fusion-pairs.def: Add ALU_BRANCH entry.
2017-06-29  Julian Brown  <julian@codesourcery.com>
	    Naveen H.S  <Naveen.Hurugalawadi@cavium.com>

	* config/aarch64/aarch64-fusion-pairs.def: Add ALU_BRANCH entry.
	* config/aarch64/aarch64.c (AARCH64_FUSE_ALU_BRANCH): New fusion type.
	(thunderx2t99_tunings): Set AARCH64_FUSE_ALU_BRANCH flag.
	(aarch_macro_fusion_pair_p): Add support for AARCH64_FUSE_ALU_BRANCH.


Co-Authored-By: Naveen H.S <Naveen.Hurugalawadi@cavium.com>

From-SVN: r249828
2017-06-30 03:58:48 +00:00
Naveen H.S 509f819a8e aarch64.c (aarch_macro_fusion_pair_p): Push the check for CC usage into AARCH64_FUSE_CMP_BRANCH.
2017-06-29  Naveen H.S  <Naveen.Hurugalawadi@cavium.com>

	* config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Push the
	check for CC usage into AARCH64_FUSE_CMP_BRANCH.
	* config/i386/i386.c (ix86_macro_fusion_pair_p): Push the check for
	CC usage from generic code to here.
	* sched-deps.c (sched_macro_fuse_insns): Move the condition for
	CC usage into the target macros.

From-SVN: r249827
2017-06-30 03:50:44 +00:00
GCC Administrator 44b222cee6 Daily bump.
From-SVN: r249826
2017-06-30 00:16:27 +00:00
Maya Rashish 9b260ce0b7 netbsd.h (NETBSD_LIB_SPEC): Add -lc when creating shared objects.
2017-06-29  Maya Rashish  <coypu@sdf.org>

	* config/netbsd.h (NETBSD_LIB_SPEC): Add -lc when creating shared
	objects.

From-SVN: r249822
2017-06-29 17:23:06 -06:00
Jan Hubicka 84a1b7fe02 arm-builtins.c: Include profile-count.h
* arm/arm-builtins.c: Include profile-count.h
	* except.c (sjlj_emit_function_enter): Use
	profile_probability::unlikely.

From-SVN: r249821
2017-06-29 22:38:30 +00:00
Paolo Carlini 8e09cb8b39 class.c (add_method): Change pair of errors to error + inform.
/cp
2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>

	* class.c (add_method): Change pair of errors to error + inform.
	(handle_using_decl): Likewise.

/testsuite
2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp0x/inh-ctor3.C: Adjust for dg-message vs dg-error.
	* g++.dg/diagnostic/variadic1.C: Likewise.
	* g++.dg/gomp/udr-3.C: Likewise.
	* g++.dg/overload/error1.C: Likewise.
	* g++.dg/overload/error2.C: Likewise.
	* g++.dg/template/duplicate1.C: Likewise.
	* g++.old-deja/g++.benjamin/warn02.C: Likewise.
	* g++.old-deja/g++.brendan/arm2.C: Likewise.
	* g++.old-deja/g++.other/redecl2.C: Likewise.
	* g++.old-deja/g++.other/redecl4.C: Likewise.
	* g++.old-deja/g++.pt/memtemp78.C: Likewise.

From-SVN: r249820
2017-06-29 22:32:33 +00:00
Jason Merrill 0395a464ed * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
From-SVN: r249818
2017-06-29 17:44:11 -04:00