Commit Graph

65937 Commits

Author SHA1 Message Date
Richard Biener 0c7247cc1e re PR tree-optimization/79276 (ICE: Segmentation fault in VRP pass)
2017-01-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79276
	* tree-vrp.c (process_assert_insertions): Properly adjust common
	when removing a duplicate.

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

From-SVN: r245026
2017-01-30 14:24:37 +00:00
Richard Biener fcc216ec44 re PR tree-optimization/79256 (FAIL: gcc.dg/vect/pr25413a.c execution test)
2017-01-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79256
	* targhooks.c (default_builtin_vector_alignment_reachable): Honor
	BIGGEST_FIELD_ALIGNMENT and ADJUST_FIELD_ALIGN to fix up bogus
	alignment on TYPE.
	* tree.c (build_aligned_type): Set TYPE_USER_ALIGN.

From-SVN: r245025
2017-01-30 13:52:44 +00:00
Dominik Vogt ab4be5d1be S/390: PR target/79240: Fix assertion in s390_extzv_shift_ok.
2017-01-30  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR target/79240
	* config/s390/s390.md ("*r<noxa>sbg_<mode>_srl_bitmask")
	("*r<noxa>sbg_<mode>_sll_bitmask")
	("*extzv_<mode>_srl<clobbercc_or_nocc>")
	("*extzv_<mode>_sll<clobbercc_or_nocc>"):
	Use contiguous_bitmask_nowrap_operand.

2017-01-30  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR target/79240
	* gcc.target/s390/pr79240.c: New test.

From-SVN: r245022
2017-01-30 09:54:58 +00:00
Bill Schmidt 6687d58dbc re PR target/79268 (Wrong code generation for vec_xl and vec_xst intrinsics)
[gcc]

2017-01-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/79268
	* config/rs6000/altivec.h (vec_xl): Revise #define.
	(vec_xst): Likewise.

[gcc/testsuite]

2017-01-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/79268
	* gcc.target/powerpc/pr79268.c: New file.
	* gcc.target/powerpc/vsx-elemrev-1.c: Delete file.
	* gcc.target/powerpc/vsx-elemrev-2.c: Likewise.
	* gcc.target/powerpc/vsx-elemrev-3.c: Likewise.
	* gcc.target/powerpc/vsx-elemrev-4.c: Likewise.

From-SVN: r245021
2017-01-30 03:32:59 +00:00
Uros Bizjak 7b4bc98402 i386.c (print_reg): Use REGNO instead of true_regnum.
* config/i386/i386.c (print_reg): Use REGNO instead of true_regnum.

From-SVN: r245009
2017-01-28 19:43:56 +01:00
Bernd Schmidt 711ce02129 re PR rtl-optimization/79194 (ICE in rtl_verify_bb_insns, at cfgrtl.c:2661 (error: flow control insn inside a basic block))
2017-01-27  Bernd Schmidt  <bschmidt@redhat.com>

	PR rtl-optimization/79194
	* cprop.c (one_cprop_pass): Move deletion of code after unconditional
	traps before call to bypass_conditional_jumps.

	PR rtl-optimization/79194
	* gcc.dg/torture/pr79194.c: New test.

From-SVN: r244993
2017-01-27 12:40:44 -07:00
Vladimir Makarov d8321b33d3 re PR rtl-optimization/71374 (ICE on valid code at -O1 and above on x86_64-linux-gnu: in extract_constrain_insn, at recog.c:2190)
2017-01-27  Vladimir Makarov  <vmakarov@redhat.com>

	PR tree-optimization/71374
	* lra-constraints.c (check_conflict_input_operands): New.
	(match_reload): Use it.

2017-01-27  Vladimir Makarov  <vmakarov@redhat.com>

	PR tree-optimization/71374
	* testsuite/gcc.target/i386/pr71374.c: New.

From-SVN: r244991
2017-01-27 18:08:14 +00:00
Vladimir Makarov 9eb7045b54 re PR target/79131 (ICE: in extract_constrain_insn, at recog.c:2213, big-endian ARM)
2017-01-27  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/79131
	* lra-assigns.c (find_hard_regno_for_1): Take endianess for into
	account to calculate conflict_set.

2017-01-27  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/79131
	* gcc.target/arm/pr79131.c: Rename to gcc.target/arm/pr79131-1.c.
	* gcc.target/arm/pr79131-2.c: New.

From-SVN: r244989
2017-01-27 16:50:11 +00:00
Bin Cheng 3f54004b09 re PR rtl-optimization/78559 (wrong code due to tree if-conversion?)
PR rtl-optimization/78559
	* combine.c (try_combine): Discard REG_EQUAL and REG_EQUIV for
	other_insn in combine.

	gcc/testsuite
	PR rtl-optimization/78559
	* gcc.c-torture/execute/pr78559.c: New test.

From-SVN: r244979
2017-01-27 14:42:23 +00:00
Martin Jambor f6a24a94a6 [brigfe] Small fixes
2017-01-27  Pekka Jaaskelainen  <pekka.jaaskelainen@parmance.com>

	* configure.ac: Moved the white list of enabling BRIG FE to
	libhsail-rt/configure.tgt.  
	* configure: Regenerated.
	* MAINTAINERS: Updated maintainers for BRIG FE and libhsail-rt.

gcc/
	* builtin-types.def: Use unsigned_char_type_node for BT_UINT8.  Use
	uint16_type_node for BT_UINT16.

gcc/brig/
	* config-lang.in: Removed stale target-libbrig reference.

libhsail-rt/
	* configure.tgt: Moved the white list of supported targets here
	from configure.ac.  Added i[3456789]86-*-linux* as a supported env
	for the BRIG FE.
	* README: Added a proper description of what libhsail-rt is.

From-SVN: r244978
2017-01-27 15:35:07 +01:00
David Malcolm 71103b6104 docs: Add __GIMPLE and __RTL to the "Internals" doc
gcc/ChangeLog:
	* doc/sourcebuild.texi (Testsuites): Add "GIMPLE Tests" and
	"RTL Tests" to menu.
	(GIMPLE Tests): New node.
	(RTL Tests): New node.

From-SVN: r244977
2017-01-27 14:25:59 +00:00
Richard Biener 40b6bff965 re PR tree-optimization/79245 (Inefficient loop distribution to memcpy)
2017-01-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79245
	* tree-loop-distribution.c (distribute_loop): Apply cost
	modeling also to detected patterns.

	* gcc.dg/tree-ssa/ldist-23.c: XFAIL.
	* gcc.dg/tree-ssa/ldist-25.c: New testcase.

From-SVN: r244976
2017-01-27 13:56:59 +00:00
Richard Biener b002f3b9e1 re PR tree-optimization/71433 (-Warray-bounds false positive with -O2)
2017-01-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71433
	* tree-vrp.c (register_new_assert_for): Revert earlier changes.
	(compare_assert_loc): New function.
	(process_assert_insertions): Sort and optimize assert locations
	to remove duplicates and push down identical assertions on
	edges to their destination block.

	* gcc.dg/Warray-bounds-21.c: New testcase.

From-SVN: r244974
2017-01-27 12:30:43 +00:00
Richard Biener 38f50ab65a re PR tree-optimization/79244 (ice in replace_uses_by, at tree-cfg.c:1866)
2017-01-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79244
	* tree-vrp.c (remove_range_assertions): Forcefully propagate
	out SSA names even if abnormal.

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

From-SVN: r244973
2017-01-27 12:24:54 +00:00
Jakub Jelinek 89dc4c9488 realmpfr.h: Poison MPFR_RND{N,Z,U,D}.
* realmpfr.h: Poison MPFR_RND{N,Z,U,D}.
	* gimple-ssa-sprintf.c (format_floating_max): Use GMP_RNDN
	instead of MPFR_RNDN.

From-SVN: r244966
2017-01-27 12:28:34 +01:00
Richard Earnshaw 6ca513f9b2 [ARM] Fix PR target/79239 - unrecognized insn after pragma gcc pop_options
{committed for rearnsha}

It turns out that because the compiler uses a hash table to save the
cl_target_option structures it is unsafe to modify the result of
build_target_option_node() (doing so will cause the hash lookup to
fail).  This PR was due to not properly understanding this limitation.

The fix is to create temporary copies of the cl_target_option nodes for
use during target option processing and then only creating the tree node
once the options have been suitably modified.

gcc:
        PR target/79239
        * arm.c (arm_option_override): Don't call build_target_option_node
        until after doing all option overrides.
        (arm_valid_target_attribute_tree): Likewise.

gcc/testsuite:
        * gcc.target/arm/pr79239.c: New test.

From-SVN: r244965
2017-01-27 11:22:30 +00:00
Martin Liska c7181f1393 Enhance doc for -fprofile-arcs
2017-01-27  Martin Liska  <mliska@suse.cz>

	* doc/invoke.texi (-fprofile-arcs): Document profiling support
	for {cd}tors and C++ {cd}tors.

From-SVN: r244964
2017-01-27 09:58:34 +00:00
Dominik Vogt d876f5cd02 S/390: Fix matching setmem_long_and*.
The attached patch reactivates the setmem_long_and* patterns on S/390
that have not been generated for a while.

gcc/ChangeLog:

2017-01-27  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* config/s390/s390.md ("*setmem_long_and")
	("*setmem_long_and_31z"): Use zero_extend instead of and.

gcc/testsuite/ChangeLog:

2017-01-27  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* gcc.target/s390/md/setmem_long-1.c: Remove xfail, skip with -O0.

From-SVN: r244963
2017-01-27 08:07:26 +00:00
Martin Sebor 0fb9ec83c3 gimple-ssa-sprintf.c (format_floating): Simplify the computation of precision to avoid preprocessor conditional.
gcc/ChangeLog:
	* gimple-ssa-sprintf.c (format_floating): Simplify the computation
	of precision to avoid preprocessor conditional.

From-SVN: r244961
2017-01-26 19:45:32 -07:00
Martin Sebor 9976a81057 gimple-ssa-sprintf.c (format_floating): Test HAVE_XFmode and HAVE_DFmode before using XFmode or DFmode.
gcc/ChangeLog:
	* gimple-ssa-sprintf.c (format_floating): Test HAVE_XFmode and
	HAVE_DFmode before using XFmode or DFmode.
	(parse_directive): Avoid using the z length modifier to avoid
	the ISO C++98 does not support the ‘z’ gnu_printf length modifier.

From-SVN: r244957
2017-01-26 16:37:17 -07:00
Martin Sebor 31c87a433c PR middle-end/78703 - fprintf-return-value floating point handling incorrect in locales with a mulltibyte decimal point
gcc/ChangeLog:
        PR middle-end/78703
        * gimple-ssa-sprintf.c (adjust_for_width_or_precision): Change
        to accept adjustment as an array.
        (get_int_range): New function.
        (struct directive): Make width and prec arrays.
        (directive::set_width, directive::set_precision): Call get_int_range.
        (format_integer, format_floating): Handle width and precision ranges.
        (format_string, parse_directive): Same.

gcc/testsuite/ChangeLog:
        PR middle-end/78703
        * gcc.dg/tree-ssa/builtin-snprintf-warn-1.c: Update
        * gcc.dg/tree-ssa/builtin-sprintf-warn-9.c: Rename...
        * gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: ...to this.
        * gcc.dg/tree-ssa/builtin-sprintf-warn-9.c: New test.

From-SVN: r244956
2017-01-26 16:07:02 -07:00
Jakub Jelinek b0670cc0eb re PR c++/79129 (ICE with -fdebug-types-section starting with r240578)
PR debug/79129
	* dwarf2out.c (generate_skeleton_bottom_up): For children with
	comdat_type_p set, just clone them, but keep the children in the
	original DIE.

	* g++.dg/debug/dwarf2/pr79129.C: New test.

From-SVN: r244955
2017-01-26 22:45:57 +01:00
Jakub Jelinek f7c06c0f99 re PR debug/78835 (ICE with -fdebug-types-section and member function)
PR debug/78835
	* dwarf2out.c (prune_unused_types): Mark all functions with DIEs
	which have direct callers with -fvar-tracking-assignments enabled
	in the current TU.
	(resolve_addr): Avoid adding skeleton DIEs for DW_AT_call_origin
	inside of type units.

	* g++.dg/debug/dwarf2/pr78835.C: New test.

From-SVN: r244954
2017-01-26 22:44:49 +01:00
Martin Sebor 5d93da1d11 PR middle-end/78703 -fprintf-return-value floating point handling incorrect in locales with a mulltibyte decimal point
gcc/ChangeLog:
	PR middle-end/78703
	* gimple-ssa-sprintf.c (struct result_range): Add likely and
	unlikely counters.
	(struct format_result): Replace number_chars, number_chars_min,
	and number_chars_max with a single member of struct result_range.
	Remove bounded.
	(format_result::operator+=): Adjust.
	(struct fmtresult): Remove bounded.  Handle likely and unlikely
	counters.
	(fmtresult::adjust_for_width_or_precision): New function.
	(fmtresult:type_max_digits): New function.
	(bytes_remaining): Handle likely and unlikely counters.
	(min_bytes_remaining): Remove.
	(format_percent): Simplify.
	(format_integer, format_floating): Set likely and unlikely counters.
	(get_string_length, format_character, format_string): Same.
	(format_plain, should_warn_p): New function.
	(maybe_warn): Call should_warn_p.  Update diagnostic messages
	and handle those for all directives, including plain strings.
	(format_directive): Handle likely and unlikely counters.
	Remove unnecessary quoting from diagnostics.  Add an informational
	note.
	(add_bytes): Remove.
	(pass_sprintf_length::compute_format_length): Simplify.
	(try_substitute_return_value): Handle likely and unlikely counters.

gcc/testsuite/ChangeLog:

	PR middle-end/78703
	* gcc.dg/format/pr78569.c: Adjust.
	* gcc.dg/tree-ssa/builtin-snprintf-warn-2.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-2.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-5.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-2.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-4.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-6.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-7.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-9.c: Same.
	* gcc.dg/tree-ssa/builtin-sprintf.c: Same.

From-SVN: r244953
2017-01-26 14:14:18 -07:00
Carl Love 0277816607 rs6000-c (altivec_overloaded_builtins): Remove bogus entries for the P8V_BUILTIN_VEC_VGBBD built-ins
gcc/ChangeLog:

2017-01-26  Carl Love  <cel@us.ibm.com>

        * config/rs6000/rs6000-c (altivec_overloaded_builtins): Remove
        bogus entries for the P8V_BUILTIN_VEC_VGBBD built-ins

From-SVN: r244943
2017-01-26 17:39:38 +00:00
Vladimir Makarov 15961e4a1b re PR target/79131 (ICE: in extract_constrain_insn, at recog.c:2213, big-endian ARM)
2017-01-26  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/79131
	* lra-assigns.c (setup_live_pseudos_and_spill_after_risky): Take
	endianess for subregs into account.
	* lra-constraints.c (lra_constraints): Do risky transformations
	always on the first iteration.
	* lra-lives.c (check_pseudos_live_through_calls): Add arg
	last_call_used_reg_set.
	(process_bb_lives): Define and use last_call_used_reg_set.
	* lra.c (lra): Always continue after lra_constraints on the first
	iteration.

2017-01-26  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/79131
	* gcc.target/arm/pr79131.c: New.

From-SVN: r244942
2017-01-26 17:08:12 +00:00
Kirill Yukhin b63144aa0f AVX-512. Fix constants for 32b variant.
gcc/testsuite/
	* gcc.target/i386/avx512bw-kshiftlq-2.c: Use unsigned long long
	constant.
	* gcc.target/i386/avx512bw-kshiftrq-2.c: Ditto.

From-SVN: r244941
2017-01-26 16:56:12 +00:00
Jakub Jelinek b5f75f0b64 avx512fintrin.h (_ktest_mask16_u8, [...]): Move to ...
* config/i386/avx512fintrin.h (_ktest_mask16_u8,
	_ktestz_mask16_u8, _ktestc_mask16_u8, _kadd_mask16): Move to ...
	* config/i386/avx512dqintrin.h (_ktest_mask16_u8,
	_ktestz_mask16_u8, _ktestc_mask16_u8, _kadd_mask16): ... here.
	* config/i386/i386-builtin.def (__builtin_ia32_ktestchi,
	__builtin_ia32_ktestzhi, __builtin_ia32_kaddhi): Use
	OPTION_MASK_ISA_AVX512DQ instead of OPTION_MASK_ISA_AVX512F.
	* config/i386/sse.md (SWI1248_AVX512BWDQ2): New mode iterator.
	(kadd<mode>, ktest<mode>): Use it instead of SWI1248_AVX512BWDQ.
testsuite/
	* gcc.target/i386/avx512f-kaddw-1.c: Renamed to ...
	* gcc.target/i386/avx512dq-kaddw-1.c: ... this.  New test.  Replace
	avx512f with avx512dq.
	* gcc.target/i386/avx512f-ktestw-1.c: Renamed to ...
	* gcc.target/i386/avx512dq-ktestw-1.c: ... this.  New test.  Replace
	avx512f with avx512dq.
	* gcc.target/i386/avx512f-ktestw-2.c: Renamed to ...
	* gcc.target/i386/avx512dq-ktestw-2.c: ... this.  New test.  Replace
	avx512f with avx512dq.

From-SVN: r244929
2017-01-26 13:24:58 +01:00
Marek Polacek 0a38b341a8 re PR c/79199 (ICE with -Wduplicated-branches)
PR c/79199
	* fold-const.c (operand_equal_p) [COND_EXPR]: Use OP_SAME_WITH_NULL
	for the third operand.

	* c-c++-common/Wduplicated-branches-13.c: New test.

From-SVN: r244928
2017-01-26 11:37:33 +00:00
Jakub Jelinek 6e6cf7b08a re PR middle-end/79236 (Many libgomp tests fail if configured with --enable-offload-targets=nvptx-none but NVidia HW or libcuda.so.1 unavailable)
PR middle-end/79236
	* omp-low.c (struct omp_context): Add simt_stmt field.
	(scan_omp_for): Return omp_context *.
	(scan_omp_simd): Set simt_stmt on the non-_simt_ SIMD
	context to the _simt_ SIMD stmt.
	(lower_omp_for): For combined SIMD with sibling _simt_
	SIMD, make sure to use the same decls in _looptemp_
	clauses as in the sibling.

From-SVN: r244924
2017-01-26 12:05:03 +01:00
David Sherwood ebff5c3f80 re PR middle-end/79212 (internal compiler error: in maybe_lookup_decl_in_outer_ctx, at omp-low.c:4134)
2017-01-26  David Sherwood  <david.sherwood@arm.com>

    gcc/
	PR middle-end/79212
	* gimplify.c (omp_notice_variable): Add GOVD_SEEN flag to variables in
	all contexts.

    gcc/testsuite/
	PR middle-end/79212
	* gfortran.dg/gomp/sharing-4.f90: New test.

From-SVN: r244922
2017-01-26 10:41:35 +00:00
Jakub Jelinek 1a27fab1ad re PR target/70465 (Poor code for x87 asm)
PR target/70465
	* reg-stack.c (emit_swap_insn): Instead of fld a; fld b; fxchg %st(1);
	emit fld b; fld a; if possible.

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

From-SVN: r244921
2017-01-26 09:46:36 +01:00
Jakub Jelinek e6d55103c3 update-copyright.py: Add libhsail-rt to self.default_dirs and call self.add_dir on it.
contrib/
	* update-copyright.py: Add libhsail-rt to self.default_dirs
	and call self.add_dir on it.  Add Intel Corporation to external
	authors.
gcc/
	* brig-builtins.def: Update copyright years.
	* config/arm/arm_acle_builtins.def: Update copyright years.
gcc/brig/
	Update copyright years.
gcc/testsuite/
	* brig.dg/dg.exp: Update copyright years.
	* lib/brig-dg.exp: Update copyright years.
	* lib/brig.exp: Update copyright years.
libhsail-rt/
	Update copyright years.
libstdc++-v3/
	* libsupc++/eh_atomics.h: Update copyright years.
	* testsuite/20_util/unique_ptr/cons/default.cc: Update copyright years.

From-SVN: r244920
2017-01-26 09:26:48 +01:00
Michael Meissner b5aa1281e1 re PR target/79179 (PowerPC64: -mcpu=power9 creates stxsd with bad offset)
[gcc]
2017-01-25  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79179
	* config/rs6000/vsx.md (vsx_extract_<mode>_store): Use wY
	constraint instead of o for the stxsd instruction.

[gcc/testsuite]
2017-01-25  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79179
	* gcc.target/powerpc/pr79179.c: New test.

From-SVN: r244917
2017-01-26 04:16:11 +00:00
Carl Love 5332c89ea0 rs6000-c (altivec_overloaded_builtins): Fix order of entries for ALTIVEC_BUILTIN_VEC_PACKS and P8V_BUILTIN_VEC_VGBBD.
gcc/ChangeLog:

2017-01-25  Carl Love  <cel@us.ibm.com>

        * config/rs6000/rs6000-c (altivec_overloaded_builtins): Fix order
        of entries for ALTIVEC_BUILTIN_VEC_PACKS and P8V_BUILTIN_VEC_VGBBD.

gcc/testsuite/ChangeLog:

2017-01-25  Carl Love  <cel@us.ibm.com>
        * gcc.target/powerpc/builtins-3-p8.c:  Add missing tests for the
        vec_packs built-ins

From-SVN: r244904
2017-01-25 16:23:48 +00:00
Jonathan Wakely 25b0128ee3 Fix "classe" typo in C++ Dialect Options docs
* doc/invoke.texi (C++ Dialect Options): Fix typo.

From-SVN: r244901
2017-01-25 15:01:10 +00:00
Richard Biener c287389223 re PR target/69264 (ICE building spidermonkey -mcpu=970 -maltivec -O3: rs6000_builtin_vectorization_cost, at config/rs6000/rs6000.c:4350)
2017-01-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/69264
	* target.def (vector_alignment_reachable): Improve documentation.
	* doc/tm.texi: Regenerate.
	* targhooks.c (default_builtin_vector_alignment_reachable): Simplify
	and add a comment.
	* tree-vect-data-refs.c (vect_supportable_dr_alignment): Revert
	earlier changes with respect to TYPE_USER_ALIGN.
	(vector_alignment_reachable_p): Likewise.  Improve dumping.

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

From-SVN: r244897
2017-01-25 12:30:41 +00:00
Kyrylo Tkachov 9aa483a2d8 [ARM] PR target/79145 Fix xordi3 expander for immediate operands in iWMMXt
PR target/79145
	* config/arm/arm.md (xordi3): Force constant operand into a register
	for TARGET_IWMMXT.

	* gcc.target/arm/pr79145.c: New test.

From-SVN: r244894
2017-01-25 11:10:30 +00:00
Kyrylo Tkachov a5a2202779 [doc] Correct optimisation levels documentation for -fstore-merging
* doc/invoke.texi (-fstore-merging): Correct default optimization
	levels at which it is enabled.
	(-O): Move -fstore-merging from list to...
	(-O2): ... Here.

From-SVN: r244893
2017-01-25 10:13:53 +00:00
Richard Biener 5c628c3e6f re PR debug/78363 (ICE in in force_type_die, at dwarf2out.c:24864)
2017-01-25  Richard Biener  <rguenther@suse.de>

	PR debug/78363
	* omp-expand.c: Include debug.h.
	(expand_omp_taskreg): Make sure to generate early debug before
	outlining anything from a function.
	(expand_omp_target): Likewise.
	(grid_expand_target_grid_body): Likewise.

	* g++.dg/gomp/pr78363-1.C: New testcase.
	* g++.dg/gomp/pr78363-2.C: Likewise.
	* g++.dg/gomp/pr78363-3.C: Likewise.

From-SVN: r244892
2017-01-25 09:48:10 +00:00
Maxim Ostapenko e5e391d630 re PR lto/79061 ([LTO][ASAN] LTO plus ASAN fails with "AddressSanitizer: initialization-order-fiasco")
PR lto/79061

gcc/

	* asan.c (get_translation_unit_decl): New function.
	(asan_add_global): Extract modules file name from globals
	TRANSLATION_UNIT_DECL name.

gcc/fortran/

	* f95-lang.c (gfc_create_decls): Include stringpool.h.
	Pass main_input_filename to build_translation_unit_decl.

gcc/ada/

	* gcc-interface/utils.c (get_global_context): Pass main_input_filename
	to build_translation_unit_decl.

gcc/c/

	* c-decl.c (pop_scope): Pass main_input_filename to
	build_translation_unit_decl.

gcc/cp/

	* decl.c (cxx_init_decl_processing): Pass main_input_filename
	to build_translation_unit_decl.

From-SVN: r244890
2017-01-25 09:45:40 +02:00
Eric Botcazou b20ba138ef re PR target/77439 (wrong code for sibcall with longcall, APCS frame and VFP)
PR target/77439
	* config/arm/arm.c (arm_function_ok_for_sibcall): Add back restriction
	for long calls with APCS frame and VFP.

From-SVN: r244879
2017-01-24 17:15:02 +00:00
David Malcolm c2e8432763 Add "__RTL" to cc1
gcc/c-family/ChangeLog:
	* c-common.c (c_common_reswords): Add "__RTL".
	* c-common.h (enum rid): Add RID_RTL.

gcc/c/ChangeLog:
	* c-parser.c: Include "read-rtl-function.h" and
	"run-rtl-passes.h".
	(c_parser_declaration_or_fndef): Rename "gimple-pass-list" in
	grammar to gimple-or-rtl-pass-list.  Add rtl-function-definition
	production.  Update for renaming of field "gimple_pass" to
	"gimple_or_rtl_pass".  If __RTL was seen, call
	c_parser_parse_rtl_body.  Convert a timevar_push/pop pair
	to an auto_timevar, to cope with early exit.
	(c_parser_declspecs): Update RID_GIMPLE handling for renaming of
	field "gimple_pass" to "gimple_or_rtl_pass", and for renaming of
	c_parser_gimple_pass_list to c_parser_gimple_or_rtl_pass_list.
	Handle RID_RTL.
	(c_parser_parse_rtl_body): New function.
	* c-tree.h (enum c_declspec_word): Add cdw_rtl.
	(struct c_declspecs): Rename field "gimple_pass" to
	"gimple_or_rtl_pass".  Add field "rtl_p".
	* gimple-parser.c (c_parser_gimple_pass_list): Rename to...
	(c_parser_gimple_or_rtl_pass_list): ...this, updating accordingly.
	* gimple-parser.h (c_parser_gimple_pass_list): Rename to...
	(c_parser_gimple_or_rtl_pass_list): ...this.

gcc/ChangeLog:
	* cfg.c (original_copy_tables_initialized_p): New function.
	* cfg.h (original_copy_tables_initialized_p): New decl.
	* cfgrtl.c (relink_block_chain): Guard the call to
	free_original_copy_tables with a call to
	original_copy_tables_initialized_p.
	* cgraph.h (symtab_node::native_rtl_p): New decl.
	* cgraphunit.c (symtab_node::native_rtl_p): New function.
	(symtab_node::needed_p): Don't assert for early assembly output
	for __RTL functions.
	(cgraph_node::finalize_function): Set "force_output" for __RTL
	functions.
	(cgraph_node::analyze): Bail out early for __RTL functions.
	(analyze_functions): Update assertion to support __RTL functions.
	(cgraph_node::expand): Bail out early for __RTL functions.
	* final.c (rest_of_clean_state): Don't call delete_tree_ssa for
	__RTL functions.
	* function.h (struct function): Update comment for field
	"pass_startwith".
	* gimple-expr.c: Include "tree-pass.h".
	(gimple_has_body_p): Return false for __RTL functions.
	* Makefile.in (OBJS): Add run-rtl-passes.o.
	* pass_manager.h (gcc::pass_manager::get_rest_of_compilation): New
	accessor.
	(gcc::pass_manager::get_clean_slate): New accessor.
	* passes.c: Include "insn-addr.h".
	(should_skip_pass_p): Add logging.  Update logic for running
	"expand" to be compatible with both __GIMPLE and __RTL.  Guard
	property-provider override so it is only done for gimple passes.
	Don't skip dfinit.
	(skip_pass): New function.
	(execute_one_pass): Call skip_pass when skipping passes.
	* read-md.c (md_reader::read_char): Support filtering
	the input to a subset of line numbers.
	(md_reader::md_reader): Initialize fields
	m_first_line and m_last_line.
	(md_reader::read_file_fragment): New function.
	* read-md.h (md_reader::read_file_fragment): New decl.
	(md_reader::m_first_line): New field.
	(md_reader::m_last_line): New field.
	* read-rtl-function.c (function_reader::create_function): Only
	create cfun if it doesn't already exist.  Set PROP_rtl on cfun's
	curr_properties.  Set DECL_INITIAL to a dummy block.
	(read_rtl_function_body_from_file_range): New function.
	* read-rtl-function.h (read_rtl_function_body_from_file_range):
	New decl.
	* run-rtl-passes.c: New file.
	* run-rtl-passes.h: New file.

gcc/testsuite/ChangeLog:
	* gcc.dg/rtl/aarch64/asr_div1.c: New test case.
	* gcc.dg/rtl/aarch64/pr71779.c: New test case.
	* gcc.dg/rtl/rtl.exp: New file.
	* gcc.dg/rtl/test.c: New file.
	* gcc.dg/rtl/truncated-rtl-file.c: New test case.
	* gcc.dg/rtl/unknown-rtx-code.c: New test case.
	* gcc.dg/rtl/x86_64/dfinit.c: New test case.
	* gcc.dg/rtl/x86_64/different-structs.c: New test case.
	* gcc.dg/rtl/x86_64/final.c: New test case.
	* gcc.dg/rtl/x86_64/into-cfglayout.c: New test case.
	* gcc.dg/rtl/x86_64/ira.c: New test case.
	* gcc.dg/rtl/x86_64/pro_and_epilogue.c: New test case.
	* gcc.dg/rtl/x86_64/test-multiple-fns.c: New test case.
	* gcc.dg/rtl/x86_64/test-return-const.c.after-expand.c: New test case.
	* gcc.dg/rtl/x86_64/test-return-const.c.before-fwprop.c: New test case.
	* gcc.dg/rtl/x86_64/test-rtl.c: New test case.
	* gcc.dg/rtl/x86_64/test_1.h: New file.
	* gcc.dg/rtl/x86_64/times-two.c.after-expand.c: New test case.
	* gcc.dg/rtl/x86_64/times-two.c.before-df.c: New test case.
	* gcc.dg/rtl/x86_64/times-two.h: New file.
	* gcc.dg/rtl/x86_64/vregs.c: New test case.

From-SVN: r244878
2017-01-24 17:07:36 +00:00
Jeff Law 82b239054d microblaze.h (ASM_FORMAT_PRIVATE_NAME): Increase buffer size.
* config/microblaze/microblaze.h (ASM_FORMAT_PRIVATE_NAME): Increase
	buffer size.

From-SVN: r244877
2017-01-24 08:49:32 -07:00
David Edelsohn 3fbbfbc9b5 Fix typo.
From-SVN: r244874
2017-01-24 09:32:36 -05:00
Bin Cheng cf8d19de26 re PR tree-optimization/79159 (spurious array-bounds warning)
PR tree-optimization/79159
	* tree-ssa-loop-niter.c (get_cst_init_from_scev): New function.
	(record_nonwrapping_iv): Imporve boundary using above function if no
	value range information.

	gcc/testsuite
	PR tree-optimization/79159
	* g++.dg/tree-ssa/pr79159.C: New test.

From-SVN: r244868
2017-01-24 13:09:27 +00:00
Pekka Jääskeläinen 5fd1486ce5 Brig front-end
2017-01-24  Pekka Jääskeläinen <pekka@parmance.com>
	    Martin Jambor  <mjambor@suse.cz>

	* Makefile.def (target_modules): Added libhsail-rt.
	(languages): Added language brig.
	* Makefile.in: Regenerated.
	* configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Added
	tgarget-libhsail-rt.  Make brig unsupported on untested architectures.
	* configure: Regenerated.

gcc/
	* brig-builtins.def: New file.
	* builtins.def (DEF_HSAIL_BUILTIN): New macro.
	(DEF_HSAIL_ATOMIC_BUILTIN): Likewise.
	(DEF_HSAIL_SAT_BUILTIN): Likewise.
	(DEF_HSAIL_INTR_BUILTIN): Likewise.
	(DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN): Likewise.
	* builtin-types.def (BT_INT8): New.
	(BT_INT16): Likewise.
	(BT_UINT8): Likewise.
	(BT_UINT16): Likewise.
	(BT_FN_ULONG): Likewise.
	(BT_FN_UINT_INT): Likewise.
	(BT_FN_UINT_ULONG): Likewise.
	(BT_FN_UINT_LONG): Likewise.
	(BT_FN_UINT_PTR): Likewise.
	(BT_FN_ULONG_PTR): Likewise.
	(BT_FN_INT8_FLOAT): Likewise.
	(BT_FN_INT16_FLOAT): Likewise.
	(BT_FN_UINT32_FLOAT): Likewise.
	(BT_FN_UINT16_FLOAT): Likewise.
	(BT_FN_UINT8_FLOAT): Likewise.
	(BT_FN_UINT64_FLOAT): Likewise.
	(BT_FN_UINT16_UINT32): Likewise.
	(BT_FN_UINT32_UINT16): Likewise.
	(BT_FN_UINT16_UINT16_UINT16): Likewise.
	(BT_FN_INT_PTR_INT): Likewise.
	(BT_FN_UINT_PTR_UINT): Likewise.
	(BT_FN_LONG_PTR_LONG): Likewise.
	(BT_FN_ULONG_PTR_ULONG): Likewise.
	(BT_FN_VOID_UINT64_UINT64): Likewise.
	(BT_FN_UINT8_UINT8_UINT8): Likewise.
	(BT_FN_INT8_INT8_INT8): Likewise.
	(BT_FN_INT16_INT16_INT16): Likewise.
	(BT_FN_INT_INT_INT): Likewise.
	(BT_FN_UINT_FLOAT_UINT): Likewise.
	(BT_FN_FLOAT_UINT_UINT): Likewise.
	(BT_FN_ULONG_UINT_UINT): Likewise.
	(BT_FN_ULONG_UINT_PTR): Likewise.
	(BT_FN_ULONG_ULONG_ULONG): Likewise.
	(BT_FN_UINT_UINT_UINT): Likewise.
	(BT_FN_VOID_UINT_PTR): Likewise.
	(BT_FN_UINT_UINT_PTR: Likewise.
	(BT_FN_UINT32_UINT64_PTR): Likewise.
	(BT_FN_INT_INT_UINT_UINT): Likewise.
	(BT_FN_UINT_UINT_UINT_UINT): Likewise.
	(BT_FN_UINT_UINT_UINT_PTR): Likewise.
	(BT_FN_UINT_ULONG_ULONG_UINT): Likewise.
	(BT_FN_ULONG_ULONG_ULONG_ULONG): Likewise.
	(BT_FN_LONG_LONG_UINT_UINT): Likewise.
	(BT_FN_ULONG_ULONG_UINT_UINT): Likewise.
	(BT_FN_VOID_UINT32_UINT64_PTR): Likewise.
	(BT_FN_VOID_UINT32_UINT32_PTR): Likewise.
	(BT_FN_UINT_UINT_UINT_UINT_UINT): Likewise.
	(BT_FN_UINT_FLOAT_FLOAT_FLOAT_FLOAT): Likewise.
	(BT_FN_ULONG_ULONG_ULONG_UINT_UINT): Likewise.
	* doc/frontends.texi: List BRIG FE.
	* doc/install.texi (Testing): Add BRIG tesring requirements.
	* doc/invoke.texi (Overall Options): Mention BRIG.
	* doc/standards.texi (Standards): Doucment BRIG HSA version.

gcc/brig/

	* Make-lang.in: New file.
	* brig-builtins.h: Likewise.
	* brig-c.h: Likewise.
	* brig-lang.c: Likewise.
	* brigspec.c: Likewise.
	* config-lang.in: Likewise.
	* lang-specs.h: Likewise.
	* lang.opt: Likewise.
	* brigfrontend/brig-arg-block-handler.cc: Likewise.
	* brigfrontend/brig-atomic-inst-handler.cc: Likewise.
	* brigfrontend/brig-basic-inst-handler.cc: Likewise.
	* brigfrontend/brig-branch-inst-handler.cc: Likewise.
	* brigfrontend/brig-cmp-inst-handler.cc: Likewise.
	* brigfrontend/brig-code-entry-handler.cc: Likewise.
	* brigfrontend/brig-code-entry-handler.h: Likewise.
	* brigfrontend/brig-comment-handler.cc: Likewise.
	* brigfrontend/brig-control-handler.cc: Likewise.
	* brigfrontend/brig-copy-move-inst-handler.cc: Likewise.
	* brigfrontend/brig-cvt-inst-handler.cc: Likewise.
	* brigfrontend/brig-fbarrier-handler.cc: Likewise.
	* brigfrontend/brig-function-handler.cc: Likewise.
	* brigfrontend/brig-function.cc: Likewise.
	* brigfrontend/brig-function.h: Likewise.
	* brigfrontend/brig-inst-mod-handler.cc: Likewise.
	* brigfrontend/brig-label-handler.cc: Likewise.
	* brigfrontend/brig-lane-inst-handler.cc: Likewise.
	* brigfrontend/brig-machine.c: Likewise.
	* brigfrontend/brig-machine.h: Likewise.
	* brigfrontend/brig-mem-inst-handler.cc: Likewise.
	* brigfrontend/brig-module-handler.cc: Likewise.
	* brigfrontend/brig-queue-inst-handler.cc: Likewise.
	* brigfrontend/brig-seg-inst-handler.cc: Likewise.
	* brigfrontend/brig-signal-inst-handler.cc: Likewise.
	* brigfrontend/brig-to-generic.cc: Likewise.
	* brigfrontend/brig-to-generic.h: Likewise.
	* brigfrontend/brig-util.cc: Likewise.
	* brigfrontend/brig-util.h: Likewise.
	* brigfrontend/brig-variable-handler.cc: Likewise.
	* brigfrontend/phsa.h: Likewise.


gcc/testsuite/

	* lib/brig-dg.exp: New file.
	* lib/brig.exp: Likewise.
	* brig.dg/README: Likewise.
	* brig.dg/dg.exp: Likewise.
	* brig.dg/test/gimple/alloca.hsail: Likewise.
	* brig.dg/test/gimple/atomics.hsail: Likewise.
	* brig.dg/test/gimple/branches.hsail: Likewise.
	* brig.dg/test/gimple/fbarrier.hsail: Likewise.
	* brig.dg/test/gimple/function_calls.hsail: Likewise.
	* brig.dg/test/gimple/kernarg.hsail: Likewise.
	* brig.dg/test/gimple/mem.hsail: Likewise.
	* brig.dg/test/gimple/mulhi.hsail: Likewise.
	* brig.dg/test/gimple/packed.hsail: Likewise.
	* brig.dg/test/gimple/smoke_test.hsail: Likewise.
	* brig.dg/test/gimple/variables.hsail: Likewise.
	* brig.dg/test/gimple/vector.hsail: Likewise.

include/

	* hsa.h: Moved here from libgomp/plugin/hsa.h.

libgomp/

	* plugin/hsa.h: Moved to top level include.
	* plugin/plugin-hsa.c: Chanfgd include of hsa.h accordingly.

libhsail-rt/

	* Makefile.am: New file.
	* target-config.h.in: Likewise.
	* configure.ac: Likewise.
	* configure: Likewise.
	* config.h.in: Likewise.
	* aclocal.m4: Likewise.
	* README: Likewise.
	* Makefile.in: Likewise.
	* include/internal/fibers.h: Likewise.
	* include/internal/phsa-queue-interface.h: Likewise.
	* include/internal/phsa-rt.h: Likewise.
	* include/internal/workitems.h: Likewise.
	* rt/arithmetic.c: Likewise.
	* rt/atomics.c: Likewise.
	* rt/bitstring.c: Likewise.
	* rt/fbarrier.c: Likewise.
	* rt/fibers.c: Likewise.
	* rt/fp16.c: Likewise.
	* rt/misc.c: Likewise.
	* rt/multimedia.c: Likewise.
	* rt/queue.c: Likewise.
	* rt/sat_arithmetic.c: Likewise.
	* rt/segment.c: Likewise.
	* rt/workitems.c: Likewise.


Co-Authored-By: Martin Jambor <mjambor@suse.cz>

From-SVN: r244867
2017-01-24 13:45:56 +01:00
Richard Biener e1e41b6f10 re PR translation/79208 (Typo in gcc/ipa-devirt.c:1631)
2017-01-24  Richard Biener  <rguenther@suse.de>

	PR translation/79208
	* ipa-devirt.c (odr_types_equivalent_p): Fix typo in diagnostic.

From-SVN: r244866
2017-01-24 12:41:07 +00:00
Martin Jambor cf157d80bc [PR 79198] Call ipa-prop func summary destructor
2017-01-24  Martin Jambor  <mjambor@suse.cz>

	PR bootstrap/79198
	* ipa-prop.c (ipa_free_all_node_params): Call summary destructor.
	* ipa-prop.c (ipa_node_params_t::insert): Initialize fields known_csts
	and known_contexts.

From-SVN: r244860
2017-01-24 11:04:21 +01:00
Aldy Hernandez 4cd7b1a9e0 re PR middle-end/79123 (incorrect -Walloca-larger-than: alloca may be too large due to conversion from long int to long unsigned int)
PR middle-end/79123
	* gimple-ssa-warn-alloca.c (alloca_call_type): Make sure
	casts from signed to unsigned really don't have a range.

From-SVN: r244859
2017-01-24 09:50:33 +00:00
Markus Trippelsdorf cf8e20bfd8 Fix build failure with MPFR 2.4.x
* gimple-ssa-sprintf.c (format_floating): Change MPFR_RNDx to
	GMP_RNDx for compatiblity.

From-SVN: r244858
2017-01-24 09:32:16 +00:00
Martin Liska ad8040243a Fix false positive for -Walloc-size-larger-than (PR bootstrap/79132).
2017-01-24  Martin Liska  <mliska@suse.cz>

	PR bootstrap/79132
	* tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Insert assert
	that would prevent us to call alloca with -1 as argument.

From-SVN: r244857
2017-01-24 08:48:36 +00:00
Jakub Jelinek 5d286a68cf dwarf2out.c (output_compilation_unit_header, [...]): Avoid -Wformat-security warning.
* dwarf2out.c (output_compilation_unit_header, output_file_names):
	Avoid -Wformat-security warning.

From-SVN: r244855
2017-01-24 09:24:57 +01:00
Andrew Pinski 5f407e5751 aarch64.c (thunderx2t99_addrcost_table): Improve cost table.
2017-01-23  Andrew Pinski  <apinski@cavium.com>

        * config/aarch64/aarch64.c (thunderx2t99_addrcost_table): Improve
        cost table.

From-SVN: r244851
2017-01-23 18:17:33 -08:00
Martin Sebor f7864c9f7b Amend recent entry.
From-SVN: r244849
2017-01-23 18:22:59 -07:00
Martin Sebor 02f1ef408f PR middle-end/78703 - -fprintf-return-value floating point handling incorrect...
PR middle-end/78703 - -fprintf-return-value floating point handling incorrect in locales with a mulltibyte decimal point
	* gimple-ssa-sprintf.c (warn_level): New global.
	(format_integer): Use it here and throughout the rest of the file.
	Use the same switch to compute sign as base.
	(maybe_warn): New function.
	(format_directive): Factor out warnings into maybe_warn.
	Add debugging output.  Use warn_level.
	(add_bytes): Use warn_level.
	(pass_sprintf_length::compute_format_length): Add debugging output.
	(try_substitute_return_value): Same.
	(pass_sprintf_length::handle_gimple_call): Set and use warn_level.

From-SVN: r244847
2017-01-23 18:10:10 -07:00
Martin Sebor a151e93b2b PR middle-end/78703 - -fprintf-return-value floating point handling incorrect...
PR middle-end/78703 - -fprintf-return-value floating point handling incorrect in locales with a mulltibyte decimal point
	* gimple-ssa-sprintf.c (struct format_result): Remove constant member.
	(struct fmtresult, format_integer, format_floating): Adjust.
	(get_string_length, format_string,format_directive): Same.
	(pass_sprintf_length::compute_format_length): Same.
	(try_substitute_return_value): Simplify slightly.

From-SVN: r244846
2017-01-23 18:06:34 -07:00
Martin Sebor 954b452ada PR middle-end/78703 - -fprintf-return-value floating point handling incorrect...
PR middle-end/78703 - -fprintf-return-value floating point handling incorrect in locales with a mulltibyte decimal point
	* gimple-ssa-sprintf.c (pass_sprintf_length::gate): Adjust formatting.
	(fmtresult::operator+=): Outlined.
	(struct fmtresult): Add ctors.
	(struct conversion_spec): Rename...
	(struct directive): ...to this.  Add and remove data members.
	(directive::set_width, directive::set_precision): New functions.
	(format_percent): Use fmtresult ctor.
	(get_width_and_precision): Remove.
	(format_integer): Make naming changes.  Avoid computing width and
	precision.
	(format_floating): Same.  Adjust indentation.
	(format_character, format_none): New functions.
	(format_string): Moved character handling to format_character.
	(format_directive): Remove arguments, change return type.
	(parse_directive): New function.
	(pass_sprintf_length::compute_format_length): Move directive
	parsing to parse_directive.

From-SVN: r244845
2017-01-23 17:55:19 -07:00
Jakub Jelinek 9579db3583 tree.h (assign_assembler_name_if_neeeded): Rename to ...
* tree.h (assign_assembler_name_if_neeeded): Rename to ...
	(assign_assembler_name_if_needed): ... this.
	* tree.c (assign_assembler_name_if_neeeded): Rename to ...
	(assign_assembler_name_if_needed): ... this.
	(free_lang_data_in_cgraph): Adjust callers.
	* cgraphunit.c (cgraph_node::analyze): Likewise.
	* omp-expand.c (expand_omp_taskreg, expand_omp_target):
	Likewise.

From-SVN: r244839
2017-01-23 23:58:12 +01:00
Richard Biener 108fdd6d84 re PR tree-optimization/79088 (wrong code at -O2 on x86_64-linux-gnu)
2017-01-23  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79088
	PR tree-optimization/79188
	* tree-ssa-threadupdate.c (mark_threaded_blocks): Move code
	resetting loop bounds after last path deletion.  Reset loop
	bounds of the target loop, make code match the comments.
	* tree-ssa-threadbackwards.c (pass_early_thread_jumps::execute):
	Make sure loops need no fixups.

	* gcc.dg/torture/pr79088.c: New testcase.
	* gcc.dg/torture/pr79188.c: Likewise.

From-SVN: r244837
2017-01-23 15:29:17 -07:00
Kelvin Nilsen 28826a66fb scalar-insert-exp-3.c: New test.
gcc/testsuite/ChangeLog:

2017-01-23  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* gcc.target/powerpc/bfp/scalar-insert-exp-3.c: New test.
	* gcc.target/powerpc/bfp/scalar-insert-exp-4.c: New test.
	* gcc.target/powerpc/bfp/scalar-insert-exp-5.c: New test.
	* gcc.target/powerpc/bfp/scalar-test-data-class-0.c: Adjust return
	type of test function to reflect change in built-in function's
	return type.
	* gcc.target/powerpc/bfp/scalar-test-data-class-1.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-data-class-2.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-data-class-3.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-data-class-4.c: Adjust return
	type and second argument type to reflect change in built-in
	function's type signature.
	* gcc.target/powerpc/bfp/scalar-test-data-class-5.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-data-class-6.c: Adjust return
	type of test function to reflect change in built-in function's
	return type.
	* gcc.target/powerpc/bfp/scalar-test-data-class-7.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-neg-0.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-neg-1.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-neg-2.c: Likewise.
	* gcc.target/powerpc/bfp/scalar-test-neg-3.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-exp-0.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-exp-1.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-exp-2.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-exp-3.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-sig-0.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-sig-1.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-sig-2.c: Likewise.
	* gcc.target/powerpc/bfp/vec-extract-sig-3.c: Likewise.
	* gcc.target/powerpc/bfp/vec-insert-exp-4.c: New test.
	* gcc.target/powerpc/bfp/vec-insert-exp-5.c: New test.
	* gcc.target/powerpc/bfp/vec-insert-exp-6.c: New test.
	* gcc.target/powerpc/bfp/vec-insert-exp-7.c: New test.
	* gcc.target/powerpc/bfp/vec-test-data-class-0.c: Adjust return
	type of test function to reflect change in built-in function's
	return type.
	* gcc.target/powerpc/bfp/vec-test-data-class-1.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-2.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-3.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-4.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-5.c: Likewise.
	* gcc.target/powerpc/bfp/vec-test-data-class-6.c: Adjust types of
	test function's result and second argument to reflect change in
	built-in function's type signature.
	* gcc.target/powerpc/bfp/vec-test-data-class-7.c: Likewise.

gcc/ChangeLog:

2017-01-23  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* config/rs6000/rs6000-builtin.def (VSIEDPF): Add scalar insert
	exponent support with double type for first argument.
	* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Changed
	type returned by __builtin_vec_extract_sig,
	__builtin_vec_extract_sig_sp, and __builtin_vec_extract_sig_dp
	functions from "vector int" to "vector unsigned int" or from
	"vector long long int" to "vector unsigned long long int".
	Changed type returned by __builtin_vec_extract_exp,
	__builtin_vec_extract_exp_sp, and __builtin_vec_extract_exp_dp
	functions from "vector int" to "vector unsigned int" or from
	"vector long long int" to "vector unsigned long long int".
	Changed return type of __builtin_vec_test_data_class,
	__builtin_vec_test_data_class_sp, and
	__builtin_vec_test_data_class_dp from "vector int" to
	"vector bool int" or from "vector long long int" to "vector bool
	long long int" and changed second argument type from "unsigned
	int" to "int".  Added new overloaded function forms "vector float
	__builtin_vec_insert_exp (vector float, vector unsigned int)" and
	"vector float __builtin_vec_insert_exp_sp (vector float, vector
	unsigned int)" and "vector double __builtin_vec_insert_exp (vector
	double, vector unsigned long long int)" and "vector double
	__builtin_vec_insert_exp_dp (vector double, vector unsigned long
	long int)".  Changed return type of
	__builtin_scalar_test_data_class and
	__builtin_scalar_test_data_class_sp and
	__builtin_scalar_test_data_class_dp from "unsigned int" to "bool
	int" and changed second argument from "unsigned int" to "int".
	Changed type returned by __builtin_scalar_test_neg,
	__builtin_scalar_test_neg_sp, and __builtin_scalar_test_neg_dp
	from "int" to "bool int".  Added new overloaded function form
	"double __builtin_scalar_insert_exp (double, unsigned long long int)".
	* config/rs6000/vsx.md (xsiexpdpf): New insn for scalar insert
	exponent double-precision with floating point first argument.
	* doc/extend.texi (PowerPC AltiVec Built-in Functions): Adjust
	documentation of scalar_test_data_class, scalar_test_neg,
	scalar_extract_sig, scalar_extract_exp, scalar_insert_exp,
	vector_extract_exp, vec_extract_sig, vec_insert_exp, and
	vec_test_data_class built-in functions to reflect refinements in
	their type signatures.

From-SVN: r244834
2017-01-23 21:56:58 +00:00
Andreas Tobler 53d190c120 aarch64.c (aarch64_elf_asm_constructor): Increase size of buf.
2017-01-23  Andreas Tobler  <andreast@gcc.gnu.org>

    * config/aarch64/aarch64.c (aarch64_elf_asm_constructor): Increase
    size of buf.
    (aarch64_elf_asm_destructor): Likewise.

From-SVN: r244828
2017-01-23 20:35:50 +01:00
Bernd Schmidt 427ed3ae3e re PR rtl-optimization/71724 (ICE: Segmentation fault, deep recursion between combine_simplify_rtx and subst)
PR rtl-optimization/71724
	* combine.c (if_then_else_cond): Look for situations where it is
	beneficial to undo the work of one of the recursive calls.

From-SVN: r244817
2017-01-23 16:30:55 +00:00
Bernd Schmidt e9c4fbe9c1 re PR rtl-optimization/78634 (30% performance drop after r242832.)
PR rtl-optimization/78634
	* config/i386/i386.c (ix86_max_noce_ifcvt_seq_cost): New function.
	(TARGET_MAX_NOCE_IFCVT_SEQ_COST): Define.
	* ifcvt.c (noce_try_cmove): Add missing cost check.

testsuite/
	PR rtl-optimization/78634
	* gcc.target/i386/funcspec-11.c: Also pass -mtune=i686.

From-SVN: r244816
2017-01-23 16:17:33 +00:00
Bin Cheng 8539a302cd re PR tree-optimization/70754 (ICE during predictive commoning)
PR tree-optimization/70754
	* tree-predcom.c (stmt_combining_refs): New parameter INSERT_BEFORE.
	(reassociate_to_the_same_stmt): New parameter INSERT_BEFORE.  Insert
	combined stmt before it if not NULL.
	(combine_chains): Process refs reversely and compute dominance point
	for root ref.

	gcc/testsuite
	PR tree-optimization/70754
	* gfortran.dg/pr70754.f90: New test.

From-SVN: r244815
2017-01-23 15:59:19 +00:00
Martin Liska f368600fcd Fix strstr folding (PR tree-optimization/79196).
2017-01-23  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/79196
	* tree-ssa-strlen.c (fold_strstr_to_memcmp): Rename to ...
	(fold_strstr_to_strncmp): ... this.  Fold the pattern to strncmp
	instead of memcmp.
	(strlen_optimize_stmt): Call the renamed function.
2017-01-23  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/79196
	* gcc.dg/asan/pr79196.c: New test.
	* gcc.dg/strlenopt-30.c: Update scanned pattern.

From-SVN: r244812
2017-01-23 14:57:43 +00:00
Michael Matz d886761fd0 fix pr78384
PR tree-optimization/78384
	* tree-ssa-loop-split.c (patch_loop_exit): Use correct edge.

testsuite/
	PR tree-optimization/78384
	* gcc.dg/pr78384.c: New test.

From-SVN: r244811
2017-01-23 13:57:31 +00: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
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
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
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
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
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
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
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
Bernd Schmidt ea9f867b7b re PR rtl-optimization/79125 (ICE in rtl_verify_bb_insns, at cfgrtl.c:2661 (error: flow control insn inside a basic block))
2017-01-21  Bernd Schmidt  <bschmidt@redhat.com>

	rtl-optimization/79125
	* cprop.c (local_cprop_pass): Handle cases where we make an
	unconditional trap.

	PR rtl-optimization/79125
	* gcc.dg/torture/pr79125.c: New test.

From-SVN: r244741
2017-01-21 00:23:47 -07:00
Segher Boessenkool 80b40b8784 rs6000: Small varargs for BE SVR4 (PR61729, PR77850)
The varargs code for SVR4 puts all (integer) arguments in 4-byte slots.
When it then reads an item from there as something not a multiple of 4
bytes, it needs to adjust the address if big endian.  We didn't yet do
that.

This fixes the g++.dg/abi/scoped1.C, gcc.dg/compat/scalar-by-value-4,
and gcc.dg/compat/scalar-return-4 testcases.


	PR target/61729
	PR target/77850
	* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Adjust address to
	read from, for big endian.

From-SVN: r244740
2017-01-21 04:11:49 +01:00
Jiong Wang a876231c40 [AArch64] Only build & test pauth code for LP64
gcc/
	* config/aarch64/aarch64-builtins.c (aarch64_init_builtins): Register
	register pauth builtins for LP64 only.

libgcc/
	* config/aarch64/aarch64-unwind.h: Empty this file on ILP32.
	* unwind-dw2.c (execute_cfa_program):  Only multiplexing
	DW_CFA_GNU_window_save for AArch64 and LP64.

gcc/testsuite/
	* testsuite/gcc.target/aarch64/return_address_sign_1.c: Enable on LP64
	only.
	* testsuite/gcc.target/aarch64/return_address_sign_2.c: Likewise.
	* testsuite/gcc.target/aarch64/return_address_sign_3.c: Likewise.

From-SVN: r244732
2017-01-20 21:03:41 +00:00
Marek Polacek d2aadab150 re PR c/79152 (-Wimplicit-fallthrough false positive triggered by goto statements)
PR c/79152
	* gimplify.c (should_warn_for_implicit_fallthrough): Handle consecutive
	non-case labels.

	* c-c++-common/Wimplicit-fallthrough-35.c: New test.

From-SVN: r244726
2017-01-20 16:28:16 +00:00
Alexander Monakov 4cea867569 omp-offload: use PROP_gimple_lomp_dev
* omp-expand.c (expand_omp_simd): Clear PROP_gimple_lomp_dev regardless
	of safelen status.
	* omp-offload.c (pass_omp_device_lower::gate): Use PROP_gimple_lomp_dev.
	* passes.c (dump_properties): Handle PROP_gimple_lomp_dev.
	* tree-inline.c (expand_call_inline): Propagate PROP_gimple_lomp_dev.

From-SVN: r244717
2017-01-20 17:38:18 +03:00
Kyrylo Tkachov 8b0fb476f2 [ARM] PR target/71270 fix neon_valid_immediate for big-endian
PR target/71270
	* config/arm/arm.c (neon_valid_immediate): Reject vector constants
	in big-endian mode when they are not a single duplicated value.

From-SVN: r244716
2017-01-20 14:36:57 +00:00
Richard Biener d40036b846 BASE-VER: Bump to 7.0.1.
2017-01-20  Richard Biener  <rguenther@suse.de>

	* BASE-VER: Bump to 7.0.1.

From-SVN: r244714
2017-01-20 14:05:48 +00:00
Alexander Monakov 6943af07e9 omp-low: introduce omplow_simd_context
* omp-low.c (omplow_simd_context): New struct.  Use it...
	(lower_rec_simd_input_clauses): ...here and...
	(lower_rec_input_clauses): ...here to hold common data.  Adjust all
	references to idx, lane, max_vf, is_simt.

From-SVN: r244713
2017-01-20 17:04:06 +03:00
Graham Markall 7b96920e20 arc/nps: Use arclinux_nps linker emulation for nps
gcc/ChangeLog:

	* config/arc/arc.h (LINK_SPEC): Use arclinux_nps emulation when
	mcpu=nps400.

From-SVN: r244712
2017-01-20 13:37:28 +00:00
Martin Jambor 13293add08 [hsa] Rename hsa.[ch] to hsa-common.[ch]
2017-01-20  Martin Jambor  <mjambor@suse.cz>
        
        * hsa.h: Renaed to hsa-common.h.  Adjusted a comment.
        * hsa.c: Renaed to hsa-common.c.  Change include of gt-hsa.h to
        gt-hsa-common.h.
        * Makefile.in (OBJS): Rename hsa.o to hsa-common.o.
        (GTFILES): Rename hsa.c to hsa-common.c.
        * hsa-brig.c: Change include of hsa.h to hsa-common.h.
        * hsa-dump.c: Likewise.
        * hsa-gen.c: Likewise.
        * hsa-regalloc.c: Likewise.
        * ipa-hsa.c: Likewise.
        * omp-expand.c: Likewise.
        * omp-low.c: Likewise.
        * toplev.c: Likewise.

From-SVN: r244711
2017-01-20 14:33:29 +01:00
Marek Polacek 2ebd93e1d7 re PR c/64279 (Warning missing for "(cond) ? A : A" / if(cond) expr1; else expr1; // same expression in if and else branch)
PR c/64279
	* c-common.h (do_warn_duplicated_branches_r): Declare.
	* c-gimplify.c (c_genericize): Walk the function tree calling
	do_warn_duplicated_branches_r.
	* c-warn.c (expr_from_macro_expansion_r): New.
	(do_warn_duplicated_branches): New.
	(do_warn_duplicated_branches_r): New.
	* c.opt (Wduplicated-branches): New option.

	* c-typeck.c (build_conditional_expr): Warn about duplicated branches.

	* call.c (build_conditional_expr_1): Warn about duplicated branches.
	* semantics.c (finish_expr_stmt): Build statement using the proper
	location.

	* doc/invoke.texi: Document -Wduplicated-branches.
	* fold-const.c (operand_equal_p): Handle MODIFY_EXPR, INIT_EXPR,
	COMPOUND_EXPR, PREDECREMENT_EXPR, PREINCREMENT_EXPR,
	POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, CLEANUP_POINT_EXPR, EXPR_STMT,
	STATEMENT_LIST, and RETURN_EXPR.  For non-pure non-const functions
	return 0 only when not OEP_LEXICOGRAPHIC.
	(fold_build_cleanup_point_expr): Use the expression
	location when building CLEANUP_POINT_EXPR.
	* tree-core.h (enum operand_equal_flag): Add OEP_LEXICOGRAPHIC.
	* tree.c (add_expr): Handle error_mark_node.

	* c-c++-common/Wduplicated-branches-1.c: New test.
	* c-c++-common/Wduplicated-branches-10.c: New test.
	* c-c++-common/Wduplicated-branches-11.c: New test.
	* c-c++-common/Wduplicated-branches-12.c: New test.
	* c-c++-common/Wduplicated-branches-2.c: New test.
	* c-c++-common/Wduplicated-branches-3.c: New test.
	* c-c++-common/Wduplicated-branches-4.c: New test.
	* c-c++-common/Wduplicated-branches-5.c: New test.
	* c-c++-common/Wduplicated-branches-6.c: New test.
	* c-c++-common/Wduplicated-branches-7.c: New test.
	* c-c++-common/Wduplicated-branches-8.c: New test.
	* c-c++-common/Wduplicated-branches-9.c: New test.
	* c-c++-common/Wimplicit-fallthrough-7.c: Coalesce dg-warning.
	* g++.dg/cpp0x/lambda/lambda-switch.C: Move dg-warning.
	* g++.dg/ext/builtin-object-size3.C: Likewise.
	* g++.dg/gomp/loop-1.C: Likewise.
	* g++.dg/warn/Wduplicated-branches1.C: New test.
	* g++.dg/warn/Wduplicated-branches2.C: New test.

From-SVN: r244705
2017-01-20 12:02:50 +00:00
Martin Liska 0ce4024a35 Do not declare artificial variables in tree-profile.c to have a definition (PR lto/69188).
2017-01-20  Martin Liska  <mliska@suse.cz>

	PR lto/69188
	* gcc.dg/lto/pr69188_0.c: New test.
	* gcc.dg/lto/pr69188_1.c: New test.
2017-01-20  Martin Liska  <mliska@suse.cz>

	PR lto/69188
	* tree-profile.c (init_ic_make_global_vars): Do not call
	finalize_decl.
	(gimple_init_gcov_profiler): Likewise.

From-SVN: r244692
2017-01-20 09:45:04 +00:00
Martin Liska 2d8d3ae293 Fix IPA CP where it forgot to add a reference in cgraph (PR ipa/71190).
2017-01-20  Martin Liska  <mliska@suse.cz>

	PR ipa/71190
	* cgraph.h (maybe_create_reference): Remove argument and
	update comment.
	* cgraphclones.c (cgraph_node::create_virtual_clone): Remove one
	argument.
	* ipa-cp.c (create_specialized_node): Likewise.
	* symtab.c (symtab_node::maybe_create_reference): Handle
	VAR_DECLs and ADDR_EXPRs and select ipa_ref_use type.

From-SVN: r244687
2017-01-20 08:44:35 +00:00
Martin Liska a809d56440 Fix --enable-gather-detailed-mem-stats
2017-01-20  Martin Liska  <mliska@suse.cz>

	* read-rtl-function.c (function_reader::create_function): Use
	build_decl instread of build_decl_stat.

From-SVN: r244686
2017-01-20 08:41:22 +00:00
Andrew Senkevich d8ea3e7c3c Add AVX512 k-mask intrinsics.
gcc/
	* config/i386/avx512bwintrin.h: Add k-mask registers shift intrinsics.
	* config/i386/avx512dqintrin.h: Ditto.
	* config/i386/avx512fintrin.h: Ditto.
	* config/i386/i386-builtin-types.def: Add new types.
	* gcc/config/i386/i386.c: Handle new types.
	* config/i386/i386-builtin.def (__builtin_ia32_kshiftliqi)
	(__builtin_ia32_kshiftlihi, __builtin_ia32_kshiftlisi)
	(__builtin_ia32_kshiftlidi, __builtin_ia32_kshiftriqi)
	(__builtin_ia32_kshiftrihi, __builtin_ia32_kshiftrisi)
	(__builtin_ia32_kshiftridi): New.
	* config/i386/sse.md (k<code><mode>): Rename *k<code><mode>.

gcc/testsuite/
	* gcc.target/i386/avx512bw-kshiftld-1.c: New test.
	* gcc.target/i386/avx512bw-kshiftlq-1.c: Ditto.
	* gcc.target/i386/avx512dq-kshiftlb-1.c: Ditto.
	* gcc.target/i386/avx512f-kshiftlw-1.c: Ditto.
	* gcc.target/i386/avx512bw-kshiftrd-1.c: Ditto.
	* gcc.target/i386/avx512bw-kshiftrq-1.c: Ditto.
	* gcc.target/i386/avx512dq-kshiftrb-1.c: Ditto.
	* gcc.target/i386/avx512f-kshiftrw-1.c: Ditto.
	* gcc.target/i386/avx512bw-kshiftld-2.c: Ditto.
	* gcc.target/i386/avx512bw-kshiftlq-2.c: Ditto.
	* gcc.target/i386/avx512bw-kshiftrd-2.c: Ditto.
	* gcc.target/i386/avx512bw-kshiftrq-2.c: Ditto.
	* gcc.target/i386/avx512dq-kshiftlb-2.c: Ditto.
	* gcc.target/i386/avx512dq-kshiftrb-2.c: Ditto.
	* gcc.target/i386/avx512f-kshiftlw-2.c: Ditto.
	* gcc.target/i386/avx512f-kshiftrw-2.c: Ditto.
	* gcc.target/i386/avx-1.c: Test new intrinsics.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.

From-SVN: r244685
2017-01-20 08:37:13 +00:00
Segher Boessenkool 01334be4a0 rs6000: Fix the new SSP guard configuration code (PR79140)
I foolishly tested this with r241087 reverted.  After that revision
default_stack_protect_guard is no longer called if the compiler defaults
to using the TLS guard, which of course is the wrong thing to do if
there is some other way to enable the global guard.

This fixes it.


	PR target/78875
	PR target/79140
	* config/rs6000/rs6000.c (TARGET_STACK_PROTECT_GUARD): Unconditionally
	define to rs6000_init_stack_protect_guard.
	(rs6000_init_stack_protect_guard): New function.

From-SVN: r244677
2017-01-20 02:22:27 +01:00
Matthew Fortune d821744c63 config.gcc (supported_defaults): Add madd4.
gcc/
2017-01-19  Matthew Fortune  <matthew.fortune@imgtec.com>
	    Yunqiang Su  <yunqiang.su@imgtec.com>

	* config.gcc (supported_defaults): Add madd4.
	(with_madd4): Add validation.
	(all_defaults): Add madd4.
	* config/mips/mips.opt (mmadd4): New option.
	* gcc/config/mips/mips.h (OPTION_DEFAULT_SPECS): Add a default for
	mmadd4.
	(TARGET_CPU_CPP_BUILTINS): Add builtin_define for
	__mips_no_madd4.
	(ISA_HAS_UNFUSED_MADD4): Gate with mips_madd4.
	(ISA_HAS_FUSED_MADD4): Likewise.
	* gcc/doc/invoke.texi (-mmadd4): Document the new option.
	* gcc/doc/install.texi (--with-madd4): Document the new option.

gcc/testsuite/
2017-01-19  Matthew Fortune  <matthew.fortune@imgtec.com>

	* gcc.target/mips/madd4-1.c: New file.
	* gcc.target/mips/madd4-2.c: Likewise.
	* gcc.target/mips/mips.exp (mips_option_groups): Add ghost option
	HAS_MADD4.
	(mips_option_groups): Add -m[no-]madd4.
	(mips-dg-init): Detect default -mno-madd4.
	(mips-dg-options): Handle HAS_MADD4 arch upgrade/downgrade.
	* gcc.target/mips/mips-ps-type.c: Add -mmadd4 test option.
	* gcc.target/mips/mips-ps-type-2.c: Likewise.
	* gcc.target/mips/nmadd-1.c: Likewise.
	* gcc.target/mips/nmadd-2.c: Likewise.
	* gcc.target/mips/nmadd-3.c: Likewise.

Co-Authored-By: Yunqiang Su <yunqiang.su@imgtec.com>

From-SVN: r244676
2017-01-19 20:05:25 -05:00
Jiong Wang 312492bd5e [AArch64][3/4] New PAUTH builtins required by libgcc unwinder
gcc/
	* config/aarch64/aarch64-builtins.c (enum aarch64_builtins): New
	entries for AARCH64_PAUTH_BUILTIN_XPACLRI,
	AARCH64_PAUTH_BUILTIN_PACIA1716, AARCH64_PAUTH_BUILTIN_AUTIA1716.
	(aarch64_init_pauth_hint_builtins): New.
	(aarch64_init_builtins): Call aarch64_init_pauth_hint_builtins.
	(aarch64_expand_builtin): Expand new builtins.

From-SVN: r244669
2017-01-20 00:10:11 +00:00
Jiong Wang 27169e45d4 [AArch64][2/4] Generate dwarf information for -msign-return-address
gcc/
	* reg-notes.def (CFA_TOGGLE_RA_MANGLE): New reg-note.
	* combine-stack-adj.c (no_unhandled_cfa): Handle
	REG_CFA_TOGGLE_RA_MANGLE.
	* dwarf2cfi.c (dwarf2out_frame_debug): Handle REG_CFA_TOGGLE_RA_MANGLE.
	* config/aarch64/aarch64.c (aarch64_expand_prologue): Generates DWARF
	info for return address signing.
	(aarch64_expand_epilogue): Likewise.

From-SVN: r244667
2017-01-20 00:05:30 +00:00
Jiong Wang db58fd8954 [AArch64][1/4] Support Return address protection on AArch64
gcc/
	* config/aarch64/aarch64-opts.h (aarch64_function_type): New enum.
	* config/aarch64/aarch64-protos.h
	(aarch64_return_address_signing_enabled): New declaration.
	* config/aarch64/aarch64.c (aarch64_return_address_signing_enabled):
	New function.
	(aarch64_expand_prologue): Sign return address before it's pushed onto
	stack.
	(aarch64_expand_epilogue): Authenticate return address fetched from
	stack.
	(aarch64_override_options): Sanity check for ILP32 and ISA level.
	(aarch64_attributes): New function attributes for "sign-return-address".
	* config/aarch64/aarch64.md (UNSPEC_AUTI1716, UNSPEC_AUTISP,
	UNSPEC_PACI1716, UNSPEC_PACISP, UNSPEC_XPACLRI): New unspecs.
	("*do_return"): Generate combined instructions according to key index.
	("<pauth_mnem_prefix>sp", "<pauth_mnem_prefix1716", "xpaclri"): New.
	* config/aarch64/iterators.md (PAUTH_LR_SP, PAUTH_17_16): New integer
	iterators.
	(pauth_mnem_prefix, pauth_hint_num_a): New integer attributes.
	* config/aarch64/aarch64.opt (msign-return-address=): New.
	* doc/extend.texi (AArch64 Function Attributes): Documents
	"sign-return-address=".
	* doc/invoke.texi (AArch64 Options): Documents "-msign-return-address=".

gcc/testsuite/
	* gcc.target/aarch64/return_address_sign_1.c: New testcase for no
	combined instructions.
	* gcc.target/aarch64/return_address_sign_2.c: New testcase for combined
	instructions.
	* gcc.target/aarch64/return_address_sign_3.c: New testcase for disable
	of pointer authentication.

From-SVN: r244666
2017-01-20 00:03:20 +00:00
Matthew Fortune c9038c70bd MIPS: Documentation fix for -mlxc1-sxc1
gcc/

	* doc/invoke.texi: Add missing -mlxc1-sxc1 options to
	overall option summary.

From-SVN: r244665
2017-01-19 23:58:10 +00:00
Jiong Wang d766c52b7b [AArch64] Add commandline support for -march=armv8.3-a
gcc/
	* config/aarch64/aarch64-arches.def: New entry for "armv8.3-a".
	* config/aarch64/aarch64.h (AARCH64_FL_V8_3, AARCH64_FL_FOR_ARCH8_3,
	AARCH64_ISA_V8_3, TARGET_ARMV8_3): New.
	* doc/invoke.texi (AArch64 Options): Document "armv8.3-a".

From-SVN: r244663
2017-01-19 23:51:49 +00:00
Michael Meissner bd9cf60b31 rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Enable -mpower9-minmax by default for -mcpu=power9.
[gcc]
2017-01-19  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Enable
	-mpower9-minmax by default for -mcpu=power9.
	(ISA_3_MASKS_IEEE): Require -mvsx-small-integer to enable IEEE
	128-bit floating point.

[gcc/testsuite]
2017-01-19  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/powerpc/float128-hw.c: Do not require IEEE 128-bit
	floating point hardware to run test.

From-SVN: r244662
2017-01-19 23:31:20 +00:00
Alan Modra 945a01f921 [RS6000] Don't expand strcmp and strncmp inline when -Os
* config/rs6000/rs6000.md (cmpstrnsi, cmpstrsi): Fail if
	optimizing for size.

From-SVN: r244660
2017-01-20 09:51:53 +10:30
Alan Modra 5699b9d115 [RS6000] PR79144, cmpstrnsi optimization breaks glibc
glibc compiled with current gcc-7 fails one test due to strcmp and
strncmp appearing in the PLT.  This is because the inline expansion of
those functions falls back to a function call, but doesn't use the asm
name for the call.

	PR target/79144
	* config/rs6000/rs6000.c (expand_strn_compare): Get the asm name
	for strcmp and strncmp from corresponding builtin decl.

From-SVN: r244659
2017-01-20 09:49:19 +10:30
Uros Bizjak d445d739b9 config.gcc (x86_64-*-rtems*): Use i386/rtemself.h instead of i386/rtems-64.h.
* config.gcc (x86_64-*-rtems*): Use i386/rtemself.h
	instead of i386/rtems-64.h.
	* config/i386/rtems-64.h: Remove.

From-SVN: r244655
2017-01-19 23:00:17 +01:00
Uros Bizjak fa9205536c re PR target/78478 (Compile Error for i386-rtems)
PR target/78478
	Revert:
	2013-11-05  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/rtemself.h (LONG_DOUBLE_TYPE_SIZE): New define.

From-SVN: r244653
2017-01-19 22:38:44 +01:00
Tamar Christina ab014eb3ae aarch64.c (aarch64_simd_gen_const_vector_dup): Change int to HOST_WIDE_INT.
gcc/
2017-01-19  Tamar Christina  <tamar.christina@arm.com>

	* config/aarch64/aarch64.c (aarch64_simd_gen_const_vector_dup):
	Change int to HOST_WIDE_INT.
	* config/aarch64/aarch64-protos.h
	(aarch64_simd_gen_const_vector_dup): Likewise.
	* config/aarch64/aarch64-simd.md: Add copysign<mode>3.

gcc/testsuite/
2017-01-19  Tamar Christina  <tamar.christina@arm.com>

	* gcc/testsuite/lib/target-supports.exp
	(check_effective_target_vect_call_copysignf): Enable for AArch64.

From-SVN: r244649
2017-01-19 18:30:44 +00:00
David Malcolm 8a3a6ab451 Make LTO's implementation of LANG_HOOKS_TYPE_FOR_SIZE the default
gcc/jit/ChangeLog:
	* dummy-frontend.c (jit_langhook_type_for_size): Delete.
	(LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.

gcc/ChangeLog:
	* langhooks-def.h (lhd_type_for_size): New decl.
	(LANG_HOOKS_TYPE_FOR_SIZE): Define as lhd_type_for_size.
	* langhooks.c (lhd_type_for_size): New function, taken from
	lto_type_for_size.

gcc/lto/ChangeLog:
	* lto-lang.c (builtin_type_for_size): Convert call to
	lto_type_for_size to one through the langhook.
	(lto_type_for_size): Move to langhooks.c and rename to
	lhd_type_for_size.
	(LANG_HOOKS_TYPE_FOR_SIZE): Don't redefine.

From-SVN: r244646
2017-01-19 17:27:54 +00:00
Pat Haugen 86eb502b93 power9.md (power9-alu): Remove 'cmp' type and add define_bypass for CR latency.
* config/rs6000/power9.md (power9-alu): Remove 'cmp' type and add
	define_bypass for CR latency.
	(power9-cracked-alu): Update bypass latency and remove power9-branch.
	(power9-alu2): Add define_bypass for CR latency.
	(power9-cmp): New.
	(power9-mul): Update insn latency.
	(power9-mul-compare): Update insn latency, bypass latency and remove
	power9-branch.

From-SVN: r244645
2017-01-19 17:11:34 +00:00
Kyrylo Tkachov 197d1c095d [AArch64] Purge leftover occurrences of aarch64_nopcrelative_literal_loads
* config/aarch64/aarch64-protos.h (aarch64_nopcrelative_literal_loads):
	Delete.
	* config/aarch64/aarch64.md
	(aarch64_reload_movcp<GPF_TF:mode><P:mode>): Delete reference to
	aarch64_nopcrelative_literal_loads.
	(aarch64_reload_movcp<VALL:mode><P:mode>): Likewise.

From-SVN: r244643
2017-01-19 16:59:43 +00:00
Chenghua Xu cedb7e2c85 MIPS: Make loongson3a use fused madd.d
gcc/
	* config/mips/mips.h (ISA_HAS_FUSED_MADD4): Enable for
	TARGET_LOONGSON_3A.
	(ISA_HAS_UNFUSED_MADD4): Exclude TARGET_LOONGSON_3A.

From-SVN: r244641
2017-01-19 16:26:32 +00:00
Matthew Fortune ab6b44cb22 MIPS: PR target/78176 add -mlxc1-sxc1.
gcc/

	PR target/78176
	* config.gcc (supported_defaults): Add lxc1-sxc1.
	(with_lxc1_sxc1): Add validation.
	(all_defaults): Add lxc1-sxc1.
	* config/mips/mips.opt (mlxc1-sxc1): New option.
	* gcc/config/mips/mips.h (OPTION_DEFAULT_SPECS): Add a default for
	mlxc1-sxc1.
	(TARGET_CPU_CPP_BUILTINS): Add builtin_define for
	__mips_no_lxc1_sxc1.
	(ISA_HAS_LXC1_SXC1): Gate with mips_lxc1_sxc1.
	* gcc/doc/invoke.texi (-mlxc1-sxc1): Document the new option.
	* doc/install.texi (--with-lxc1-sxc1): Document the new option.

gcc/testsuite/

	* gcc.target/mips/lxc1-sxc1-1.c: New file.
	* gcc.target/mips/lxc1-sxc1-2.c: Likewise.
	* gcc.target/mips/mips.exp (mips_option_groups): Add ghost option
	HAS_LXC1.
	(mips_option_groups): Add -m[no-]lxc1-sxc1.
	(mips-dg-init): Detect default -mno-lxc1-sxc1.
	(mips-dg-options): Handle HAS_LXC1 arch upgrade/downgrade.

From-SVN: r244640
2017-01-19 16:05:59 +00:00
Richard Biener ed20a004e1 re PR rtl-optimization/72488 (wrong code (SIGFPE) at -Os and above on x86_64-linux-gnu (in the 64-bit mode))
2017-01-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/72488
	* tree-ssa-sccvn.c (run_scc_vn): When we abort the VN make
	sure to restore SSA info.
	* tree-ssa.c (verify_ssa): Verify SSA info is not shared.

From-SVN: r244623
2017-01-19 12:00:42 +00:00
Richard Earnshaw a57c520e2b [expand] Fix for PR rtl-optimization/79121 incorrect expansion of extend plus left shift
When generating a shift from an extended value moving from one to two
    machine registers, the type of the right shift is for the most
    significant word should be determined by the signedness of the inner
    type, not the signedness of the result type.
    
    gcc:
        PR rtl-optimization/79121
        * expr.c (expand_expr_real_2, case LSHIFT_EXPR): Look at the signedness
        of the inner type when shifting an extended value.
    
    gcc/testsuite:
        * gcc.c-torture/execute/pr79121.c: New test.

From-SVN: r244613
2017-01-19 10:35:38 +00:00
Jan Hubicka ea83dcf68d re PR lto/78407 (LTO breaks separate overriding of symbol aliases)
PR lto/78407
	* symtab.c (symtab_node::equal_address_to): Fix comparing of
	interposable aliases.

From-SVN: r244612
2017-01-19 10:00:56 +00:00
Peter Bergner f457ef94da re PR target/78516 (ICE in lra_assign for e500v2)
PR target/78516
	* config/rs6000/spe.md (mov_si<mode>_e500_subreg0): Fix constraints.
	Use the evmergelohi instruction.
	(mov_si<mode>_e500_subreg4_2_le): Likewise.
	(mov_sitf_e500_subreg8_2_be): Likewise.
	(mov_sitf_e500_subreg12_2_le): Likewise.
	(mov_si<mode>_e500_subreg0_2_le): Fix constraints.
	(mov_si<mode>_e500_subreg4_2_be): Likewise.
	(mov_sitf_e500_subreg8_2_le): Likewise.
	(mov_sitf_e500_subreg12_2_be): Likewise.

From-SVN: r244609
2017-01-18 20:23:35 -06:00
Bill Schmidt 20ca9ae25f altivec.md (altivec_vbpermq): Change "type" attribute from vecsimple to vecperm.
2017-01-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/altivec.md (altivec_vbpermq): Change "type"
	attribute from vecsimple to vecperm.
	(altivec_vbpermq2): Likewise.

From-SVN: r244603
2017-01-18 22:36:39 +00:00
Bill Schmidt 1c8bf56078 re PR target/79040 (vec_cntlz redefined)
2017-01-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/79040
	* config/rs6000/altivec.h: Fix typo of vec_cntlz to vec_cnttz.

From-SVN: r244602
2017-01-18 22:29:22 +00:00
Aaron Sawdey 0edd264dfc rs6000-protos.h (expand_strn_compare): Add arg.
2017-01-18  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
	* config/rs6000/rs6000-protos.h (expand_strn_compare): Add arg.
	* config/rs6000/rs6000.c (expand_strn_compare): Add ability to expand
	strcmp. Fix bug where comparison didn't stop with zero byte. Fix
	case where N arg is SIZE_MAX.
	* config/rs6000/rs6000.md (cmpstrnsi): Args to expand_strn_compare.
	(cmpstrsi): Add pattern.
2017-01-18  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
	* gcc.dg/strcmp-1.c: New test.
	* gcc.dg/strncmp-1.c: Add test for a bug that escaped.

From-SVN: r244598
2017-01-18 14:56:16 -06:00
Michael Meissner b7d3a6a6b2 rs6000-c.c (altivec_overloaded_builtins): Add __builtin_vec_revb builtins.
[gcc]
2017-01-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add
	__builtin_vec_revb builtins.
	* config/rs6000/rs6000-builtins.def (P9V_BUILTIN_XXBRQ_V16QI): Add
	built-in functions to support generation of the ISA 3.0 XXBR<x>
	vector byte reverse instructions.
	(P9V_BUILTIN_XXBRQ_V1TI): Likewise.
	(P9V_BUILTIN_XXBRD_V2DI): Likewise.
	(P9V_BUILTIN_XXBRD_V2DF): Likewise.
	(P9V_BUILTIN_XXBGW_V4SI): Likewise.
	(P9V_BUILTIN_XXBGW_V4SF): Likewise.
	(P9V_BUILTIN_XXBGH_V8HI): Likewise.
	(P9V_BUILTIN_VEC_REVB): Likewise.
	* config/rs6000/vsx.md (p9_xxbrq_v1ti): New insns/expanders to
	generate the ISA 3.0 XXBR<x> vector byte reverse instructions.
	(p9_xxbrq_v16qi): Likewise.
	(p9_xxbrd_<mode>, VSX_D iterator): Likewise.
	(p9_xxbrw_<mode>, VSX_W iterator): Likewise.
	(p9_xxbrh_v8hi): Likewise.
	* config/rs6000/altivec.h (vec_revb): Define if ISA 3.0.
	* doc/extend.texi (RS/6000 Altivec Built-ins): Document the
	vec_revb built-in functions.

[gcc/testsuite]
2017-01-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/powerpc/p9-xxbr-1.c: New test.
	* gcc.target/powerpc/p9-xxbr-2.c: Likewise.

From-SVN: r244593
2017-01-18 19:30:38 +00:00
Uros Bizjak a711887ed9 re PR rtl-optimization/78952 (Combine does not convert 8-bit sign-extract to a zero-extract for QImode operations)
PR rtl-optimization/78952
	* config/i386/i386.md (any_extract): New code iterator.
	(*insvqi_2): Use any_extract for source operand.
	(*insvqi_3): Use any_shiftrt for source operand.

testsuite/ChangeLog:

	PR rtl-optimization/78952
	* gcc.target/i386/pr78952-1.c: New test.
	* gcc.target/i386/pr78952-2.c: Ditto.

From-SVN: r244591
2017-01-18 20:24:30 +01:00
Wilco Dijkstra 9bca63d44b SHA1H instructions may be scheduled after a SHA1C instruction that uses the same input register.
SHA1H instructions may be scheduled after a SHA1C instruction
that uses the same input register.  However SHA1C updates its input,
so if SHA1H is scheduled after it, it requires an extra move.
Increase the priority of SHA1H to ensure it gets scheduled
earlier, avoiding the move.

    gcc/
	* config/aarch64/aarch64.c (aarch64_sched_adjust_priority)
	New function.
	(TARGET_SCHED_ADJUST_PRIORITY): Define target hook.

From-SVN: r244586
2017-01-18 18:23:34 +00:00
Maxim Ostapenko 5807fb918d re PR lto/79061 ([LTO][ASAN] LTO plus ASAN fails with "AddressSanitizer: initialization-order-fiasco")
PR lto/79061
gcc/

	* asan.c (get_translation_unit_decl): New function.
	(asan_add_global): Extract modules file name from globals
	TRANSLATION_UNIT_DECL in lto mode.
	* tree.c (build_translation_unit_decl): Add source location for newly
	built TRANSLATION_UNIT_DECL.

gcc/lto/

	* lto.c (lto_read_decls): accept location cache for
	TRANSLATION_UNIT_DECL.
	
gcc/testsuite/

	* gcc.dg/cpp/mi1.c: Adjust testcase.
	* gcc.dg/pch/cpp-3.c: Likewise.

From-SVN: r244581
2017-01-18 18:06:31 +02:00
Matthias Klose 8465132c9b re PR libobjc/78697 (--with-target-bdw-gc-include shouldn't be required to be per multilib)
2017-01-18  Matthias Klose  <doko@ubuntu.com>

        PR libobjc/78697
        * configure.ac: Allow default for --with-target-bdw-gc-include.
        * configure: Regenerate.

        PR libobjc/78698
        * configure.ac: Use the libgc.la file when available.
        * configure: Regenerate.

2017-01-18  Matthias Klose  <doko@ubuntu.com>

       * doc/install.texi: Allow default for --with-target-bdw-gc-include.

From-SVN: r244579
2017-01-18 15:48:54 +00:00
Bill Schmidt dfc42f08ce altivec.h (vec_bperm): Change #define.
[gcc]

2016-01-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/altivec.h (vec_bperm): Change #define.
	* config/rs6000/altivec.md (UNSPEC_VBPERMD): New enum constant.
	(altivec_vbpermq2): New define_insn.
	(altivec_vbpermd): Likewise.
	* config/rs6000/rs6000-builtin.def (VBPERMQ2): New monomorphic
	function interface.
	(VBPERMD): Likewise.
	(VBPERM): New polymorphic function interface.
	* config/rs6000/r6000-c.c (altivec_overloaded_builtins_table):
	Add entries for P9V_BUILTIN_VEC_VBPERM.
	* doc/extend.texi: Add interfaces for vec_bperm.

[gcc/testsuite]

2016-01-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/p8vector-builtin-8.c: Add new form for
	vec_bperm.
	* gcc.target/powerpc/p9-vbpermd.c: New file.

From-SVN: r244578
2017-01-18 15:04:50 +00:00
Andreas Krebbel f3981e7ecd S/390: Downcase first letter of error messages.
gcc/testsuite/ChangeLog:

2017-01-18  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/htm-builtins-compile-2.c (must_not_compile1):
	(must_not_compile2): Downcase first letter of error messages.
	* gcc.target/s390/target-attribute/tattr-13.c (b): Likewise.
	* gcc.target/s390/vector/vec-abi-vararg-2.c: Likewise.

gcc/ChangeLog:

2017-01-18  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390-c.c (s390_expand_overloaded_builtin): Downcase
	first letter of error messages.
	(s390_resolve_overloaded_builtin): Likewise.
	* config/s390/s390.c (s390_expand_builtin): Likewise.
	(s390_invalid_arg_for_unprototyped_fn): Likewise.
	(s390_valid_target_attribute_inner_p): Likewise.
	* config/s390/s390.md ("tabort"): Likewise.

From-SVN: r244577
2017-01-18 15:03:18 +00:00
Jakub Jelinek 928bff1905 tattr-2.c: Add -fno-ipa-icf to dg-options.
* gcc.target/s390/target-attribute/tattr-2.c: Add -fno-ipa-icf
	to dg-options.
	(p0): Add missing dg-error.

From-SVN: r244571
2017-01-18 12:51:46 +01:00
Toma Tabacu d5432112a7 MIPS: Fix generation of Loongson-specific division and modulo instructions.
gcc

	* config/mips/mips.h (ISA_HAS_DIV3): Remove unused macro.
	(ISA_AVOID_DIV_HILO): New macro.
	(ISA_HAS_DIV): Use new ISA_AVOID_DIV_HILO macro.
	(ISA_HAS_DDIV): Likewise.

From-SVN: r244570
2017-01-18 10:57:17 +00:00
Markus Trippelsdorf 01f9d481c5 Fix number of occurrences.
From-SVN: r244569
2017-01-18 09:58:33 +00:00
Markus Trippelsdorf 7107b50211 Spelling fix
From-SVN: r244568
2017-01-18 08:54:33 +00:00
Markus Trippelsdorf 4bbc35f33f Fix PR70182 -- missing "on" in mangling of unresolved operators
The ABI says:

<unresolved-name>
   ::= [gs] <base-unresolved-name>
   ::= sr <unresolved-type> <base-unresolved-name>
   ::= srN <unresolved-type> <unresolved-qualifier-level>+ E <base-unresolved-name>
   ::= [gs] sr <unresolved-qualifier-level>+ E <base-unresolved-name>

<base-unresolved-name>
   ::= <simple-id>
   ::= on <operator-name>
   ::= on <operator-name> <template-args>
   ::= dn <destructor-name

libiberty:

	PR c++/70182
	* cp-demangle.c (d_unqualified_name): Handle "on" for
	operator names.
	* testsuite/demangle-expected: Add tests.

gcc/cp:

	PR c++/70182
	* mangle.c (write_template_args): Add "on" for operator names.

gcc:

	PR c++/70182
	* doc/invoke.texi (fabi-version): Mention mangling fix for
	operator names.

From-SVN: r244567
2017-01-18 08:49:11 +00:00
Markus Trippelsdorf f6efea5163 Fix PR77489 -- mangling of discriminator >= 1
libiberty:

	PR c++/77489
	* cp-demangle.c (d_discriminator): Handle discriminator >= 10.
	* testsuite/demangle-expected: Add tests for discriminator.

gcc:
	PR c++/77489
	* doc/invoke.texi (fabi-version): Document discriminator mangling.

gcc/cp:

	PR c++/77489
	* mangle.c (write_discriminator): Handle discriminator >= 10.

From-SVN: r244566
2017-01-18 08:40:05 +00:00
Segher Boessenkool 1b3254e4bb -mstack-protector-guard and friends (PR78875)
Currently, on PowerPC, code compiled with -fstack-protector will load
the canary from -0x7010(13) (for -m64) or from -0x7008(2) (for -m32)
if GCC was compiled against GNU libc 2.4 or newer or some other libc
that supports -fstack-protector, and from the global variable
__stack_chk_guard otherwise.

This does not work well for Linux and other OS kernels and similar.
For such non-standard applications, this patch creates a few new
command-line options.  The relevant new use cases are:

-mstack-protector-guard=global
Use the __stack_chk_guard variable, no matter how this GCC was
configured.

-mstack-protector-guard=tls
Use the canary from TLS.  This will error out if this GCC was built
with a C library that does not support it.

-mstack-protector-guard=tls -mstack-protector-register=<reg>
-mstack-protector-offset=<offset>
Load the canary from offset <off> from base register <reg>.


	PR target/78875
	* config/rs6000/rs6000-opts.h (stack_protector_guard): New enum.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Handle
	the new options.
	* config/rs6000/rs6000.md (stack_protect_set): Handle the new more
	flexible settings.
	(stack_protect_test): Ditto.
	* config/rs6000/rs6000.opt (mstack-protector-guard=,
	mstack-protector-guard-reg=, mstack-protector-guard-offset=): New
	options.
	* doc/invoke.texi (Option Summary) [RS/6000 and PowerPC Options]:
	Add -mstack-protector-guard=, -mstack-protector-guard-reg=, and
	-mstack-protector-guard-offset=.
	(RS/6000 and PowerPC Options): Ditto.

gcc/testsuite/
	* gcc.target/powerpc/ssp-1.c: New testcase.
	* gcc.target/powerpc/ssp-2.c: New testcase.

From-SVN: r244556
2017-01-17 23:02:42 +01:00
Uros Bizjak 4ed04e93c2 i386.h (MASK_CLASS_P): New define.
* config/i386/i386.h (MASK_CLASS_P): New define.
	* config/i386/i386.c (inline_secondary_memory_needed): Ensure that
	there are no registers from different register sets also when
	mask registers are used.  Update function comment.
	* config/i386/i386.md (*movsi_internal): Split (*k/*krm) alternative
	to (*k/*r) and (*k/*km) alternatives.

From-SVN: r244548
2017-01-17 20:44:53 +01:00
Wilco Dijkstra 8144a493dd This patch simplifies the handling of EH return.
This patch simplifies the handling of EH return.  We force the use of the
frame pointer so the return location is always at FP + 8.  This means we
can emit a simple volatile access in EH_RETURN_HANDLER_RTX without needing md
patterns, splitters and frame offset calculations.  The new implementation also
fixes various bugs in aarch64_final_eh_return_addr, which does not work with
-fomit-frame-pointer, alloca or outgoing arguments.

    gcc/
	* config/aarch64/aarch64.md (eh_return): Remove pattern and splitter.
	* config/aarch64/aarch64.h (AARCH64_EH_STACKADJ_REGNUM): Remove.
	(EH_RETURN_HANDLER_RTX): New define.
	* config/aarch64/aarch64.c (aarch64_frame_pointer_required):
	Force frame pointer in EH return functions.
	(aarch64_expand_epilogue): Add barrier for eh_return.
	(aarch64_final_eh_return_addr): Remove.
	(aarch64_eh_return_handler_rtx): New function.
	* config/aarch64/aarch64-protos.h (aarch64_final_eh_return_addr):
	Remove.
	(aarch64_eh_return_handler_rtx): New prototype.

    testsuite/
	* gcc.target/aarch64/eh_return.c: New test.

From-SVN: r244547
2017-01-17 19:34:26 +00:00
Bill Schmidt a660777486 altivec.h (vec_rlmi): New #define.
[gcc]

2017-01-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/altivec.h (vec_rlmi): New #define.
	(vec_vrlnm): Likewise.
	(vec_rlnm): Likewise.
	* config/rs6000/altivec.md (UNSPEC_VRLMI): New UNSPEC enum value.
	(UNSPEC_VRLNM): Likewise.
	(VIlong): New mode iterator.
	(altivec_vrl<VI_char>mi): New define_insn.
	(altivec_vrl<VI_char>nm): Likewise.
	* config/rs6000/rs6000-builtin.def (VRLWNM): New monomorphic
	function entry.
	(VRLDNM): Likewise.
	(RLNM): New polymorphic function entry.
	(VRLWMI): New monomorphic function entry.
	(VRLDMI): Likewise.
	(RLMI): New polymorphic function entry.
	* config/rs6000/r6000-c.c (altivec_overloaded_builtin_table): Add
	new entries for P9V_BUILTIN_VEC_RLMI and P9V_BUILTIN_VEC_RLNM.
	* doc/extend.texi: Add description of vec_rlmi, vec_rlnm, and
	vec_vrlnm.

[gcc/testsuite]

2017-01-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* vec-rlmi-rlnm.c: New file.

From-SVN: r244546
2017-01-17 19:14:09 +00:00
Jakub Jelinek 1e0424d998 re PR debug/78839 (DWARF output different between GCC 5 and 6)
PR debug/78839
	* dwarf2out.c (field_byte_offset): Restore the
	PCC_BITFIELD_TYPE_MATTERS behavior for INTEGER_CST DECL_FIELD_OFFSET
	and DECL_FIELD_BIT_OFFSET.  Use fold_build2 instead of build2 + fold.
	(analyze_variants_discr, gen_variant_part): Use fold_build2 instead
	of build2 + fold.

From-SVN: r244545
2017-01-17 19:32:13 +01:00
Eric Botcazou f46fe37e86 re PR ada/67205 (eliminate No_Implicit_Dynamic_Code restriction violations)
PR ada/67205
	* config/aarch64/aarch64.c (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Define

From-SVN: r244543
2017-01-17 18:02:55 +00:00
Jakub Jelinek c5b7d7b78f re PR debug/71669 (DW_AT_data_bit_offset is not emitted for dwarf4 and above)
PR debug/71669
	* dwarf2out.c (add_data_member_location_attribute): For constant
	offset bitfield emit for -gdwarf-5 DW_AT_data_bit_offset attribute
	instead of DW_AT_data_member_location, DW_AT_bit_offset and
	DW_AT_byte_size attributes.

From-SVN: r244542
2017-01-17 18:42:06 +01:00
Eric Botcazou d25fabdc8e rs6000.c (rs6000_emit_move): Also use a TOC reference after forcing to constant memory when...
* config/rs6000/rs6000.c (rs6000_emit_move): Also use a TOC reference
	after forcing to constant memory when the code model is medium.

From-SVN: r244541
2017-01-17 17:33:43 +00:00
Julia Koval 0e171d5408 re PR target/76731 ([AVX512] _mm512_i32gather_epi32 and other scatter/gather routines have incorrect signature)
PR target/76731
	* config/i386/avx512fintrin.h
	(_mm512_i32gather_ps): Change __addr type to void const*.
	(_mm512_mask_i32gather_ps): Ditto.
	(_mm512_i32gather_pd): Ditto.
	(_mm512_mask_i32gather_pd): Ditto.
	(_mm512_i64gather_ps): Ditto.
	(_mm512_mask_i64gather_ps): Ditto.
	(_mm512_i64gather_pd): Ditto.
	(_mm512_mask_i64gather_pd): Ditto.
	(_mm512_i32gather_epi32): Ditto.
	(_mm512_mask_i32gather_epi32): Ditto.
	(_mm512_i32gather_epi64): Ditto.
	(_mm512_mask_i32gather_epi64): Ditto.
	(_mm512_i64gather_epi32): Ditto.
	(_mm512_mask_i64gather_epi32): Ditto.
	(_mm512_i64gather_epi64): Ditto.
	(_mm512_mask_i64gather_epi64): Ditto.
	(_mm512_i32scatter_ps): Change __addr type to void*.
	(_mm512_mask_i32scatter_ps): Ditto.
	(_mm512_i32scatter_pd): Ditto.
	(_mm512_mask_i32scatter_pd): Ditto.
	(_mm512_i64scatter_ps): Ditto.
	(_mm512_mask_i64scatter_ps): Ditto.
	(_mm512_i64scatter_pd): Ditto.
	(_mm512_mask_i64scatter_pd): Ditto.
	(_mm512_i32scatter_epi32): Ditto.
	(_mm512_mask_i32scatter_epi32): Ditto.
	(_mm512_i32scatter_epi64): Ditto.
	(_mm512_mask_i32scatter_epi64): Ditto.
	(_mm512_i64scatter_epi32): Ditto.
	(_mm512_mask_i64scatter_epi32): Ditto.
	(_mm512_i64scatter_epi64): Ditto.
	(_mm512_mask_i64scatter_epi64): Ditto.
	* config/i386/avx512pfintrin.h
	(_mm512_mask_prefetch_i32gather_pd): Change __addr type to void const*.
	(_mm512_mask_prefetch_i32gather_ps): Ditto.
	(_mm512_mask_prefetch_i64gather_pd): Ditto.
	(_mm512_mask_prefetch_i64gather_ps): Ditto.
	(_mm512_prefetch_i32scatter_pd): Change __addr type to void*.
	(_mm512_prefetch_i32scatter_ps): Ditto.
	(_mm512_mask_prefetch_i32scatter_pd): Ditto.
	(_mm512_mask_prefetch_i32scatter_ps): Ditto.
	(_mm512_prefetch_i64scatter_pd): Ditto.
	(_mm512_prefetch_i64scatter_ps): Ditto.
	(_mm512_mask_prefetch_i64scatter_pd): Ditto.
	(_mm512_mask_prefetch_i64scatter_ps): Ditto.
	* config/i386/avx512vlintrin.h
	(_mm256_mmask_i32gather_ps): Change __addr type to void const*.
	(_mm_mmask_i32gather_ps): Ditto.
	(_mm256_mmask_i32gather_pd): Ditto.
	(_mm_mmask_i32gather_pd): Ditto.
	(_mm256_mmask_i64gather_ps): Ditto.
	(_mm_mmask_i64gather_ps): Ditto.
	(_mm256_mmask_i64gather_pd): Ditto.
	(_mm_mmask_i64gather_pd): Ditto.
	(_mm256_mmask_i32gather_epi32): Ditto.
	(_mm_mmask_i32gather_epi32): Ditto.
	(_mm256_mmask_i32gather_epi64): Ditto.
	(_mm_mmask_i32gather_epi64): Ditto.
	(_mm256_mmask_i64gather_epi32): Ditto.
	(_mm_mmask_i64gather_epi32): Ditto.
	(_mm256_mmask_i64gather_epi64): Ditto.
	(_mm_mmask_i64gather_epi64): Ditto.
	(_mm256_i32scatter_ps): Change __addr type to void*.
	(_mm256_mask_i32scatter_ps): Ditto.
	(_mm_i32scatter_ps): Ditto.
	(_mm_mask_i32scatter_ps): Ditto.
	(_mm256_i32scatter_pd): Ditto.
	(_mm256_mask_i32scatter_pd): Ditto.
	(_mm_i32scatter_pd): Ditto.
	(_mm_mask_i32scatter_pd): Ditto.
	(_mm256_i64scatter_ps): Ditto.
	(_mm256_mask_i64scatter_ps): Ditto.
	(_mm_i64scatter_ps): Ditto.
	(_mm_mask_i64scatter_ps): Ditto.
	(_mm256_i64scatter_pd): Ditto.
	(_mm256_mask_i64scatter_pd): Ditto.
	(_mm_i64scatter_pd): Ditto.
	(_mm_mask_i64scatter_pd): Ditto.
	(_mm256_i32scatter_epi32): Ditto.
	(_mm256_mask_i32scatter_epi32): Ditto.
	(_mm_i32scatter_epi32): Ditto.
	(_mm_mask_i32scatter_epi32): Ditto.
	(_mm256_i32scatter_epi64): Ditto.
	(_mm256_mask_i32scatter_epi64): Ditto.
	(_mm_i32scatter_epi64): Ditto.
	(_mm_mask_i32scatter_epi64): Ditto.
	(_mm256_i64scatter_epi32): Ditto.
	(_mm256_mask_i64scatter_epi32): Ditto.
	(_mm_i64scatter_epi32): Ditto.
	(_mm_mask_i64scatter_epi32): Ditto.
	(_mm256_i64scatter_epi64): Ditto.
	(_mm256_mask_i64scatter_epi64): Ditto.
	(_mm_i64scatter_epi64): Ditto.
	(_mm_mask_i64scatter_epi64): Ditto.
	* config/i386/i386-builtin-types.def (V16SF_V16SF_PCFLOAT_V16SI_HI_INT)
	(V8DF_V8DF_PCDOUBLE_V8SI_QI_INT, V8SF_V8SF_PCFLOAT_V8DI_QI_INT)
	(V8DF_V8DF_PCDOUBLE_V8DI_QI_INT, V16SI_V16SI_PCINT_V16SI_HI_INT)
	(V8DI_V8DI_PCINT64_V8SI_QI_INT, V8SI_V8SI_PCINT_V8DI_QI_INT)
	(V8DI_V8DI_PCINT64_V8DI_QI_INT, V2DF_V2DF_PCDOUBLE_V4SI_QI_INT)
	(V4DF_V4DF_PCDOUBLE_V4SI_QI_INT, V2DF_V2DF_PCDOUBLE_V2DI_QI_INT)
	(V4DF_V4DF_PCDOUBLE_V4DI_QI_INT, V4SF_V4SF_PCFLOAT_V4SI_QI_INT)
	(V8SF_V8SF_PCFLOAT_V8SI_QI_INT, V4SF_V4SF_PCFLOAT_V2DI_QI_INT)
	(V4SF_V4SF_PCFLOAT_V4DI_QI_INT, V2DI_V2DI_PCINT64_V4SI_QI_INT)
	(V4DI_V4DI_PCINT64_V4SI_QI_INT, V2DI_V2DI_PCINT64_V2DI_QI_INT)
	(V4DI_V4DI_PCINT64_V4DI_QI_INT, V4SI_V4SI_PCINT_V4SI_QI_INT)
	(V8SI_V8SI_PCINT_V8SI_QI_INT, V4SI_V4SI_PCINT_V2DI_QI_INT)
	(V4SI_V4SI_PCINT_V4DI_QI_INT, VOID_PFLOAT_HI_V16SI_V16SF_INT)
	(VOID_PFLOAT_QI_V8SI_V8SF_INT, VOID_PFLOAT_QI_V4SI_V4SF_INT)
	(VOID_PDOUBLE_QI_V8SI_V8DF_INT, VOID_PDOUBLE_QI_V4SI_V4DF_INT)
	(VOID_PDOUBLE_QI_V4SI_V2DF_INT, VOID_PFLOAT_QI_V8DI_V8SF_INT)
	(VOID_PFLOAT_QI_V4DI_V4SF_INT, VOID_PFLOAT_QI_V2DI_V4SF_INT)
	(VOID_PDOUBLE_QI_V8DI_V8DF_INT, VOID_PDOUBLE_QI_V4DI_V4DF_INT)
	(VOID_PDOUBLE_QI_V2DI_V2DF_INT, VOID_PINT_HI_V16SI_V16SI_INT)
	(VOID_PINT_QI_V8SI_V8SI_INT, VOID_PINT_QI_V4SI_V4SI_INT)
	(VOID_PLONGLONG_QI_V8SI_V8DI_INT, VOID_PLONGLONG_QI_V4SI_V4DI_INT)
	(VOID_PLONGLONG_QI_V4SI_V2DI_INT, VOID_PINT_QI_V8DI_V8SI_INT)
	(VOID_PINT_QI_V4DI_V4SI_INT, VOID_PINT_QI_V2DI_V4SI_INT)
	(VOID_PLONGLONG_QI_V8DI_V8DI_INT, VOID_QI_V8SI_PCINT64_INT_INT)
	(VOID_PLONGLONG_QI_V4DI_V4DI_INT, VOID_PLONGLONG_QI_V2DI_V2DI_INT)
	(VOID_HI_V16SI_PCINT_INT_INT, VOID_QI_V8DI_PCINT64_INT_INT)
	(VOID_QI_V8DI_PCINT_INT_INT): Remove.
	(V16SF_V16SF_PCVOID_V16SI_HI_INT,  V8DF_V8DF_PCVOID_V8SI_QI_INT)
	(V8SF_V8SF_PCVOID_V8DI_QI_INT, V8DF_V8DF_PCVOID_V8DI_QI_INT)
	(V16SI_V16SI_PCVOID_V16SI_HI_INT, V8DI_V8DI_PCVOID_V8SI_QI_INT)
	(V8SI_V8SI_PCVOID_V8DI_QI_INT, V8DI_V8DI_PCVOID_V8DI_QI_INT)
	(VOID_PVOID_HI_V16SI_V16SF_INT, VOID_PVOID_QI_V8SI_V8DF_INT)
	(VOID_PVOID_QI_V8DI_V8SF_INT, VOID_PVOID_QI_V8DI_V8DF_INT)
	(VOID_PVOID_HI_V16SI_V16SI_INT, VOID_PVOID_QI_V8SI_V8DI_INT)
	(VOID_PVOID_QI_V8DI_V8SI_INT, VOID_PVOID_QI_V8DI_V8DI_INT)
	(V2DF_V2DF_PCVOID_V4SI_QI_INT, V4DF_V4DF_PCVOID_V4SI_QI_INT)
	(V2DF_V2DF_PCVOID_V2DI_QI_INT, V4DF_V4DF_PCVOID_V4DI_QI_INT
	(V4SF_V4SF_PCVOID_V4SI_QI_INT, V8SF_V8SF_PCVOID_V8SI_QI_INT)
	(V4SF_V4SF_PCVOID_V2DI_QI_INT, V4SF_V4SF_PCVOID_V4DI_QI_INT)
	(V2DI_V2DI_PCVOID_V4SI_QI_INT, V4DI_V4DI_PCVOID_V4SI_QI_INT)
	(V2DI_V2DI_PCVOID_V2DI_QI_INT, V4DI_V4DI_PCVOID_V4DI_QI_INT)
	(V4SI_V4SI_PCVOID_V4SI_QI_INT, V8SI_V8SI_PCVOID_V8SI_QI_INT)
	(V4SI_V4SI_PCVOID_V2DI_QI_INT, V4SI_V4SI_PCVOID_V4DI_QI_INT)
	(VOID_PVOID_QI_V8SI_V8SF_INT, VOID_PVOID_QI_V4SI_V4SF_INT)
	(VOID_PVOID_QI_V4SI_V4DF_INT, VOID_PVOID_QI_V4SI_V2DF_INT)
	(VOID_PVOID_QI_V4DI_V4SF_INT, VOID_PVOID_QI_V2DI_V4SF_INT)
	(VOID_PVOID_QI_V4DI_V4DF_INT, VOID_PVOID_QI_V2DI_V2DF_INT)
	(VOID_PVOID_QI_V8SI_V8SI_INT, VOID_PVOID_QI_V4SI_V4SI_INT)
	(VOID_PVOID_QI_V4SI_V4DI_INT, VOID_PVOID_QI_V4SI_V2DI_INT)
	(VOID_PVOID_QI_V4DI_V4SI_INT, VOID_PVOID_QI_V2DI_V4SI_INT)
	(VOID_PVOID_QI_V4DI_V4DI_INT, VOID_PVOID_QI_V2DI_V2DI_INT)
	(VOID_QI_V8SI_PCVOID_INT_INT, VOID_HI_V16SI_PCVOID_INT_INT)
	(VOID_QI_V8DI_PCVOID_INT_INT): Add.
	* config/i386/i386.c (ix86_init_mmx_sse_builtins): Adjust builtin
	definitions accordingly.

From-SVN: r244540
2017-01-17 18:03:00 +01:00
Kito Cheng 4ed543bcd4 re PR target/79079 ([6] Wrong code gen for __builtin_mul_overflow when TRULY_NOOP_TRUNCATION (32, 64) == false)
PR target/79079
	* internal-fn.c (expand_mul_overflow): Use convert_modes instead of
	gen_lowpart.

Co-Authored-By: Kuan-Lin Chen <kuanlinchentw@gmail.com>

From-SVN: r244539
2017-01-17 17:56:30 +01:00
Vladimir Makarov 31b61548d6 re PR target/79058 (ARM: internal compiler error: in extract_constrain_insn, at recog.c:2213)
2017-01-17  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/79058
	* ira-conflicts.c (ira_build_conflicts): Update total conflict
	hard regs for inner regno.

2017-01-17  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/79058
	* gcc.target/arm/pr79058.c: New.

From-SVN: r244535
2017-01-17 16:11:55 +00:00
Martin Liska 4f197ff9a8 Fix wrong assumption in contains_type_p (PR ipa/71207).
2017-01-17  Martin Liska  <mliska@suse.cz>

	PR ipa/71207
	* g++.dg/ipa/pr71207.C: New test.
2017-01-17  Martin Liska  <mliska@suse.cz>

	PR ipa/71207
	* ipa-polymorphic-call.c (contains_type_p): Fix wrong
	assumption and add comment.

From-SVN: r244530
2017-01-17 15:11:00 +00:00
Nathan Sidwell 408de159d4 ipa-visibility.c (localize_node): New function, broken out of ...
* ipa-visibility.c (localize_node): New function, broken out of	...
	(function_and_variable_visibility): ... here. Call it.

From-SVN: r244529
2017-01-17 15:04:50 +00:00
Jan Hubicka d4193b85ae re PR tree-optimization/77445 (Performance drop after r239219 on coremark test)
PR middle-end/77445
	* tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges):
	correctly set frequency of oudgoing edge.
	(duplicate_thread_path): Fix profile updating.
	* gcc.dg/tree-ssa/pr77445-2.c: New testcase.
	* gcc.dg/tree-ssa/pr77445.c: New testcase.

From-SVN: r244528
2017-01-17 12:49:41 +00:00
Jakub Jelinek 3c36aa6ba2 re PR other/79046 (g++ -print-file-name=plugin uses full version number in path)
PR other/79046
	* configure: Regenerated.
config/
	* acx.m4 (GCC_BASE_VER): New m4 function.
	(ACX_TOOL_DIRS): Require GCC_BASE_VER, for
	--with-gcc-major-version-only use just major number from BASE-VER.
gcc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	(CFLAGS-gcc.o): Add -DBASEVER=$(BASEVER_s).
	(gcc.o): Depend on $(BASEVER).
	* common.opt (dumpfullversion): New option.
	* gcc.c (driver_handle_option): Handle OPT_dumpfullversion.
	* doc/invoke.texi: Document -dumpfullversion.
	* doc/install.texi: Document --with-gcc-major-version-only.
	* configure: Regenerated.
libatomic/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libgomp/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libgcc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	* configure: Regenerated.
libssp/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
liboffloadmic/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* aclocal.m4: Include ../config/acx.m4.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libquadmath/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libmpx/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libada/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	* configure: Regenerated.
lto-plugin/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libitm/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
fixincludes/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
libcilkrts/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* aclocal.m4: Include ../config/acx.m4.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libcc1/
	* configure.ac: Add GCC_BASE_VER.  For --with-gcc-major-version-only
	use just major number from BASE-VER.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libobjc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
libstdc++-v3/
	* configure.ac: Add GCC_BASE_VER.
	* fragment.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* po/Makefile.in: Regenerated.
	* libsupc++/Makefile.in: Regenerated.
	* testsuite/Makefile.in: Regenerated.
	* src/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* include/Makefile.in: Regenerated.
	* doc/Makefile.in: Regenerated.
	* python/Makefile.in: Regenerated.
	* src/c++11/Makefile.in: Regenerated.
	* src/c++98/Makefile.in: Regenerated.
	* src/filesystem/Makefile.in: Regenerated.
libvtv/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libsanitizer/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* libbacktrace/Makefile.in: Regenerated.
	* interception/Makefile.in: Regenerated.
	* asan/Makefile.in: Regenerated.
	* ubsan/Makefile.in: Regenerated.
	* configure: Regenerated.
	* sanitizer_common/Makefile.in: Regenerated.
	* lsan/Makefile.in: Regenerated.
	* Makefile.in: Regenerated.
	* tsan/Makefile.in: Regenerated.
libgfortran/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.

From-SVN: r244521
2017-01-17 10:38:48 +01:00
Richard Biener 12314dc989 re PR tree-optimization/71433 (-Warray-bounds false positive with -O2)
2017-01-17  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71433
	* tree-vrp.c (register_new_assert_for): Merge same asserts
	on all incoming edges.
	(process_assert_insertions_for): Handle insertions at the
	beginning of BBs.

	* gcc.dg/Warray-bounds-20.c: New testcase.

From-SVN: r244520
2017-01-17 08:38:59 +00:00
Gerald Pfeifer 4b1a89aa3c cygwin.h (LIBGCJ_SONAME): Remove.
* config/i386/cygwin.h (LIBGCJ_SONAME): Remove.
	* config/i386/mingw32.h (LIBGCJ_SONAME): Remove.

From-SVN: r244517
2017-01-17 07:23:40 +00:00
Kaz Kojima d27c8bec6f re PR target/78633 ([SH] libgcc/fp-bit.c:944:1: error: invalid rtl sharing found in the insn)
PR target/78633
	* config/sh/sh.md (cmpeqsi_t+1): Call copy_rtx to avoid invalid
	RTL sharing.

From-SVN: r244516
2017-01-17 04:07:51 +00:00
Alan Modra e6750e5ce0 PR79066, non-PIC code generated for powerpc glibc with -fpic
PR target/79066
	* config/rs6000/rs6000.md (elf_high, elf_low): Disable when pic.
	* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Don't allow
	symbolic stack limit when pic.
testsuite/
	* gcc.target/powerpc/pr79066.c: New.

From-SVN: r244515
2017-01-17 13:24:11 +10:30
Martin Sebor 209042e613 PR tree-optimization/78608 - gimple-ssa-sprintf.c:570:17: runtime error: negation of -9223372036854775808 cannot be represented in type 'long int'
gcc/ChangeLog:
	* gimple-ssa-sprintf.c (tree_digits): Avoid negating TYPE_MIN.

From-SVN: r244511
2017-01-16 17:14:52 -07:00
Jeff Law 26830c2fac revert: Makefile.in (PREPROCESSOR_DEFINES): Add a level of indirection for several include directories that may be relative...
Revert:
	2016-12-02  Tadek Kijkowski  <tkijkowski@gmail.com>
        * Makefile.in (PREPROCESSOR_DEFINES): Add a level of indirection
        for several include directories that may be relative to sysroot.
        * config/i386/x-mingw32 (gplus_includedir): Define.
        (gplus_tool_includedir, gplus_backward_include_dir): Likewise.
        (native_system_includedir): Likewise.
        * config/i386/mingw32.h (STANDARD_STARTFILE_PREFIX_1): Do not
        override if TARGET_SYSTEM_ROOT is defined.
        (NATIVE_SYSTEM_HEADER_DIR): Likewise.

From-SVN: r244510
2017-01-16 16:51:57 -07:00
Jeff Law a59afbe2fe re PR tree-optimization/79090 (DSE wrongly removes store at variable offset)
2017-01-16  Jeff Law  <law@redhat.com>

	PR tree-optimization/79090
	PR tree-optimization/33562
	PR tree-optimization/61912
	PR tree-optimization/77485
	* tree-ssa-dse.c (compute_trims): Accept STMT argument.  Dump STMT
	and computed trims into the dump file.

	PR tree-optimization/79090
	PR tree-optimization/33562
	PR tree-optimization/61912
	PR tree-optimization/77485
	* tree-ssa-dse.c (compute_trims): Accept STMT argument.  Dump STMT
	and computed trims into the dump file.

From-SVN: r244509
2017-01-16 16:43:05 -07:00
Uros Bizjak af995bf019 i386.h (LIMIT_RELOAD_CLASS): Remove.
* config/i386/i386.h (LIMIT_RELOAD_CLASS): Remove.

From-SVN: r244508
2017-01-17 00:18:30 +01:00
Jakub Jelinek 98e92fb210 re PR middle-end/79089 (error: incorrect sharing of tree nodes)
PR c/79089
	* gimplify.c (gimplify_init_constructor): If want_value and
	object == lhs, unshare lhs to avoid invalid tree sharing.  Formatting
	fix.

	* gcc.c-torture/compile/pr79089.c: New test.

From-SVN: r244507
2017-01-16 22:35:30 +01:00
Jakub Jelinek e1bcfb924a re PR target/79080 (ICE: internal consistency failure (error: invalid rtl sharing found in the insn) (error: shared rtx))
PR target/79080
	* loop-doloop.c (doloop_modify): Call unshare_all_rtl_in_chain on
	sequence.  Formatting fixes.
	(doloop_optimize): Formatting fixes.

	* gcc.dg/pr79080.c: New test.

From-SVN: r244506
2017-01-16 22:34:35 +01:00
Jakub Jelinek 1c70261c9a re PR driver/49726 (-g0 file.S -g does not produce debug info)
PR driver/49726
	* gcc.c (debug_level_greater_than_spec_func): New function.
	(static_spec_functions): Add debug-level-gt spec function.
	(ASM_DEBUG_SPEC, cpp_options): Use %:debug-level-gt(0) instead of
	!g0.
	* config/darwin.h (DSYMUTIL_SPEC, ASM_DEBUG_SPEC): Likewise.
	* config/darwin9.h (DSYMUTIL_SPEC, ASM_DEBUG_SPEC): Likewise.
	* common.opt (g, gcoff, gdwarf, gdwarf-, ggdb, gno-pubnames,
	gpubnames, ggnu-pubnames, gno-record-gcc-switches,
	grecord-gcc-switches, gno-strict-dwarf, gstrict-dwarf, gstabs,
	gstabs+, gtoggle, gvms, gxcoff, gxcoff+): Add Driver flag.
c-family/
	* c.opt (gen-decls): Add Driver flag.
ada/
	* gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.

From-SVN: r244505
2017-01-16 22:33:07 +01:00
Uros Bizjak a60c335103 i386.h (HARD_REGNO_CALLER_SAVE_MODE): Apply HImode and QImode fixups to general and mask registers only.
* config/i386/i386.h (HARD_REGNO_CALLER_SAVE_MODE): Apply HImode and
	QImode fixups to general and mask registers only.

From-SVN: r244504
2017-01-16 20:58:59 +01:00
Carl Love 76689ffc1e rs6000-c (altivec_overloaded_builtins): Add support for built-in functions vector signed char vec_nabs (vector signed...
gcc/ChangeLog:

2017-01-16  Carl Love  <cel@us.ibm.com>

	* config/rs6000/rs6000-c (altivec_overloaded_builtins): Add support
	for built-in functions
	vector signed char vec_nabs (vector signed char)
	vector signed short vec_nabs (vector signed short)
	vector signed int vec_nabs (vector signed int)
	vector signed long long vec_nabs (vector signed long long)
	vector float vec_nabs (vector float)
	vector double vec_nabs (vector double)
	* config/rs6000/rs6000-builtin.def: Add definitions for NABS functions
	and NABS overload.
	* config/rs6000/altivec.md: New define_expand nabs<mode>2 types
	* config/rs6000/altivec.h: New define for vec_nabs built-in function.
	* doc/extend.texi: Update the documentation file for the new built-in
	functions.

gcc/testsuite/ChangeLog:

2017-01-16  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/builtins-3.c: New vec_nabs testcase.
	* gcc.target/powerpc/builtins-3-p8.c: New vec_nabs testcase.

From-SVN: r244501
2017-01-16 17:18:05 +00:00
Martin Sebor 1a41367709 gimple-ssa-sprintf.c (format_directive): Correct a typo in a warning message.
gcc/ChangeLog:
	* gimple-ssa-sprintf.c (format_directive): Correct a typo in a warning
	message.

From-SVN: r244500
2017-01-16 10:08:42 -07:00
Bill Schmidt 290687fb4e rs6000.c (rtx_is_swappable_p): Change UNSPEC_VSX__XXSPLTD to require special splat handling.
[gcc]

2017-01-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rtx_is_swappable_p): Change
	UNSPEC_VSX__XXSPLTD to require special splat handling.

[gcc/testsuite]

2017-01-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/swaps-p8-27.c: New.

From-SVN: r244495
2017-01-16 15:05:35 +00:00
David Malcolm 436afa16af system.h: Poison strndup (PR bootstrap/78616)
gcc/ChangeLog:
	PR bootstrap/78616
	* system.h: Poison strndup.

From-SVN: r244494
2017-01-16 15:03:41 +00:00
Alan Modra 7cefdfd5aa Powerpc bootstrap failure due to duplicate case value
PR target/79098
	* config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Don't
	use a switch.

From-SVN: r244489
2017-01-16 21:42:57 +10:30
Georg-Johann Lay 1bcd0192bf avr.h (BRANCH_COST): Increase by 4.
gcc/
	* config/avr/avr.h (BRANCH_COST) [reload_completed]: Increase by 4.

From-SVN: r244488
2017-01-16 09:48:45 +00:00
Richard Biener a99ce94c8a re PR tree-optimization/77283 (Revision 238005 disables loop unrolling)
2017-01-13  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77283
	* gimple-ssa-split-paths.c: Include gimple-ssa.h, tree-phinodes.h
	and ssa-iterators.h.
	(is_feasible_trace): Implement a cost model based on joiner
	PHI node uses.

	* gcc.dg/tree-ssa/split-path-7.c: Adjust.
	* gcc.dg/tree-ssa/split-path-8.c: New testcase.
	* gcc.dg/tree-ssa/split-path-9.c: Likewise.

From-SVN: r244487
2017-01-16 09:33:12 +00:00
Uros Bizjak 9c9a11f60d i386.c (ix86_legitimate_combined_insn): Do not call recog here.
* config/i386/i386.c (ix86_legitimate_combined_insn): Do not
	call recog here.  Assert that INSN_CODE (insn) is non-negative.

From-SVN: r244478
2017-01-15 19:42:29 +01:00
Segher Boessenkool 81e63b637a Make rtl_split_edge work for jumps that fall through (PR72749)
If a jump always falls through but that cannot be optimised away, like
is the case with the PowerPC bdnz insn if its jump target is the same as
the fallthrough, sched gets confused if it schedules some instructions
from before that jump instruction to behind it: it splits the
fallthrough branch, but the jump target isn't updated, and things fall
apart as in the PR.  This patch fixes it.

The second patch fragment makes -fsched-verbose=N work for N>=4; the
currently scheduled fragment can now contain a label.  Everything else
seems to work fine with that.


	PR target/72749
	* cfgrtl.c (rtl_split_edge): Also patch jump insns that jump to the
	fallthrough.
	* haifa-sched.c (dump_insn_stream): Don't crash if there is a label
	in the currently scheduled RTL fragment.

From-SVN: r244477
2017-01-15 18:06:00 +01:00
Segher Boessenkool 32a8d3f66a ifcvt: Don't make invalid insns for a cond trap (PR78751)
As shown in the PR, ifcvt will happily make invalid insns when given the
chance.  This patch teaches it some manners.


	PR rtl-optimization/78751
	* ifcvt.c (find_cond_trap): If we generated a non-existing insn,
	give up.

From-SVN: r244476
2017-01-15 18:03:55 +01:00
Jeff Law 0cb4b758f5 re PR tree-optimization/79090 (DSE wrongly removes store at variable offset)
PR tree-optimization/79090
	* tree-ssa-dse.c (valid_ao_ref_for_dse): Reject zero length and
	variable length stores.
	(compute_trims): Delete dead assignment to *trim_tail.
	(dse_dom_walker::dse_optimize_stmt): Optimize mem* calls with
	zero length.

From-SVN: r244472
2017-01-15 02:34:01 -07:00
Bernd Schmidt 90aead2189 re PR rtl-optimization/78626 (ICE in rtl_verify_bb_insns, at cfgrtl.c:2656 (error: flow control insn inside a basic block))
PR rtl-optimization/78626
	PR rtl-optimization/78727
	* cprop.c (one_cprop_pass): Collect unconditional traps in the middle
	of a block, and split such blocks after everything else is finished.

        PR rtl-optimization/78626
        PR rtl-optimization/78727
	* gcc.dg/torture/pr78626.c: New test.
	* gcc.dg/torture/pr78727.c: New test.

From-SVN: r244467
2017-01-14 09:52:18 -07:00
Alan Modra d6b251481d Avoid PR72749 by not using unspecs
Rather than using unspecs in doloop insns to stop combine creating
these insns, use legitimate_combined_insn.

	PR target/72749
	* combine.c (recog_for_combine_1): Set INSN_CODE before calling
	target legitimate_combined_insn.
	* config/rs6000/rs6000.c (TARGET_LEGITIMATE_COMBINED_INSN): Define.
	(rs6000_legitimate_combined_insn): New function.
	* config/rs6000/rs6000.md (UNSPEC_DOLOOP): Delete, and remove
	all uses.
	(ctr<mode>_internal3): Rename from *ctr<mode>_internal5.
	(ctr<mode>_internal4): Rename from *ctr<mode>_internal6.
	(ctr<mode>_internal1, ctr<mode>_internal2): Remove '*' from name.

From-SVN: r244465
2017-01-14 23:54:46 +10:30
Gerald Pfeifer f2b2206586 * doc/frontends.texi (G++ and GCC): Remove references to Java.
From-SVN: r244463
2017-01-14 08:03:17 +00:00
Jeff Law 1a15be6865 re PR tree-optimization/33562 (aggregate DSE disabled)
PR tree-optimization/33562
	PR tree-optimization/61912
	PR tree-optimization/77485
	* tree-ssa-dse.c (delete_dead_call): Accept gsi rather than
	a statement.
	(delete_dead_assignment): Likewise.
	(dse_dom_walker::dse_optimize_stmt): Pass in the gsi rather than
	statement to delete_dead_call and delete_dead_assignment.

From-SVN: r244461
2017-01-13 23:16:23 -07:00
David Malcolm be4aa83d6f Don't suppress bogus usage of macros from system headers in -Wformat (PR c/78304)
gcc/ChangeLog:
	PR c/78304
	* substring-locations.c (format_warning_va): Strengthen case 1 so
	that both endpoints of the substring must be within the format
	range for just the substring to be printed.

gcc/testsuite/ChangeLog:
	PR c/78304
	* gcc.dg/format/diagnostic-ranges.c (test_macro): Undef INT_FMT.
	(test_macro_2): New test.
	(test_macro_3): New test.
	(test_macro_4): New test.
	(test_non_contiguous_strings): Convert line number to line offset.
	* gcc.dg/format/pr78304-2.c: New test case.
	* gcc.dg/format/pr78304.c: New test case.

From-SVN: r244453
2017-01-13 19:27:43 +00:00
Uros Bizjak 7cdca3ec8a i386.opt (msgx): Use ix86_isa_flags2 variable.
* config/i386/i386.opt (msgx): Use ix86_isa_flags2 variable.
	* config/i386/i386.c (ix86_target_string): Add missing options
	to isa_opts and reorder options by implied ISAs.  Rename isa_opts2 to
	isa2_opts, ix86_flag_opts to flag2_opts, ix86_target_other to
	flags_other and ix86_target_other to flags2_other.  Display unknown
	isa2 options.
	(ix86_valid_target_attribute_inner_p): Add missing options and
	reorder options by implied ISAs, as in ix86_target_string.

testsuite/ChangeLog:

	* gcc.target/i386/funcspec-56.inc: Add missing options and
	reorder options by implied ISAs, as in ix86_target_string.

From-SVN: r244452
2017-01-13 19:32:44 +01:00
Richard Sandiford d3da63e543 Avoid excessively-big hash tables in empty-add cycles
A big source of cache misses when compiling a recent version of
gimple-match.ii was the call to cv_cache.empty () in clear_cv_cache.
The problem was that at one early point the hash table had grown
to 8191 entries (128k on LP64 hosts).  It then stayed at that size
for the rest of the compilation, even though subsequent uses needed
only a small number of entries (usually fewer than ten).  We would
still clear the whole 128k each time clear_cv_cache was called.

empty() already looks for cases where the hash table is very big
and cuts it down.  At the moment it fires when the table is 1M
in size and reduces it to the next selected prime above 1K (so
almost 2K in practice).  One fix would have been to lower the
threshold, but that didn't feel like the right approach.  Reducing
the current limit of 1M by a factor of 8 would be pretty significant
on its own, but I think this cv_cache behaviour would have been a
problem even with 64k or 32k tables.

I think the existing check is really for cases in which even a
well-populated table would need to be shrunk rather than cleared.
Here the problem isn't that the table is excessively big in
absolute terms, more that one outlier has made the table much
too big for the general case.

traverse() already shrinks the table if it's "too empty",
which is taken to be if:

      no. elements * 8 < capacity && capacity > 32

So an alternative would be to apply the same test (and the same choice
of shrunken size) to empty_slow too.  The patch below does this.
It gives a 2.5% improvement in gimple-match.ii compile time at -O0 -g
and doesn't seem to adversely affect any other tests I've tried.

Of course, there's a theoretical risk of a table alternating between
one large element count and one small element count.  If there was a
factor of eight difference between the two, we could shrink the table
on seeing each small element count, then grow it again when adding the
large number of elements.  That seems pretty unlikely in practice
though.

Also, empty_slow() does involve a traversal if some form of manual
gc is needed on active elements, so trying to recover from an outlier
should have even more benefit there.  (cv_cache uses automatic gc and so
the traversal gets optimised away.)

The calculation of the existing 1M threshold was assuming that each
entry was pointer-sized.  This patch makes it use the actual size of the
entry instead.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.

gcc/
	* hash-table.h (hash_table::too_empty_p): New function.
	(hash_table::expand): Use it.
	(hash_table::traverse): Likewise.
	(hash_table::empty_slot): Use sizeof (value_type) instead of
	sizeof (PTR) to convert bytes to elements.  Shrink the table
	if the current size is excessive for the current number of
	elements.

From-SVN: r244447
2017-01-13 16:00:26 +00:00
Richard Sandiford 3d8e492088 Short-circuit alt_fail case in record_reg_classes
record_reg_classes is often the hottest function when generating
unoptimised output.  It seems typical for over 60% of the instructions
it handles to be moves, and of course moves tend to be the instructions
with the longest constraint strings.

Maybe we should avoid using move constraints to set costs in unoptimised
output and instead use the "natural" class for the mode being moved.
That's too invasive for stage 3 though.

However, seeing so many moves means that we see many "failing"
alternatives, usually because of '*' or because of hard registers
in function call sequences.  The frequency of alternatives that are
detected as failures after the first operand tends again to be more
than 60%.  Previously we would continue to process the other operands
of the alternative regardless.  This patch instead adds a short-cut.

As well as avoiding unnecessary work, it means that the alt_fail
variable can be jump-threaded away.

Tested on aach64-linux-gnu and x86_64-linux-gnu.  It reduces compile
time by about 1% on some tests with "-g -O0".

gcc/
	* ira-costs.c (record_reg_classes): Break from the inner loop
	early once alt_fail is known to be true.  Update outer loop
	handling accordingly.

From-SVN: r244446
2017-01-13 15:56:04 +00:00
Jeff Law 7c9560a578 tree-ssa-dse.c (decrement_count): New function.
* tree-ssa-dse.c (decrement_count): New function.
	(increment_start_addr, maybe_trim_memstar_call): Likewise.
	(dse_dom_walker::optimize_stmt): Call maybe_trim_memstar_call directly
	when we know the partially dead statement is a mem* function.

	* gcc.dg/tree-ssa/ssa-dse-25.c: New test.

From-SVN: r244444
2017-01-13 08:50:11 -07:00
Jeff Law 9e59e99a60 re PR middle-end/61912 (Missed (partial) dead store elimination for structures on GIMPLE)
PR tree-optimization/61912
	PR tree-optimization/77485
	* tree-ssa-dse.c: Include expr.h.
	(maybe_trim_constructor_store): New function.
	(maybe_trim_partially_dead_store): Call maybe_trim_constructor_store.

	PR tree-optimization/61912
	PR tree-optimization/77485
	* g++.dg/tree-ssa/ssa-dse-1.C: New test.
	* gcc.dg/tree-ssa/pr30375: Adjust expected output.
	* gcc.dg/tree-ssa/ssa-dse-24.c: New test.

From-SVN: r244443
2017-01-13 08:46:22 -07:00
Jeff Law d155c6fef0 re PR tree-optimization/33562 (aggregate DSE disabled)
PR tree-optimization/33562
        PR tree-optimization/61912
        PR tree-optimization/77485
	* doc/invoke.texi: Document new dse-max-object-size param.
	* params.def (PARM_DSE_MAX_OBJECT_SIZE): New PARAM.
	* tree-ssa-dse.c: Include params.h.
	(dse_store_status): New enum.
	(initialize_ao_ref_for_dse): New, partially extracted from
	dse_optimize_stmt.
	(valid_ao_ref_for_dse, normalize_ref): New.
	(setup_live_bytes_from_ref, compute_trims): Likewise.
	(clear_bytes_written_by, maybe_trim_complex_store): Likewise.
	(maybe_trim_partially_dead_store): Likewise.
	(maybe_trim_complex_store): Likewise.
	(dse_classify_store): Renamed from dse_possibly_dead_store_p.
	Track what bytes live from the original store.  Return tri-state
	for dead, partially dead or live.
	(dse_dom_walker): Add constructor, destructor and new private members.
	(delete_dead_call, delete_dead_assignment): New extracted from
	dse_optimize_stmt.
	(dse_optimize_stmt): Make a member of dse_dom_walker.
	Use initialize_ao_ref_for_dse.

        PR tree-optimization/33562
        PR tree-optimization/61912
        PR tree-optimization/77485
	* gcc.dg/tree-ssa/complex-4.c: Remove xfail.
	* gcc.dg/tree-ssa/complex-5.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-9.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-18.c: New test.
	* gcc.dg/tree-ssa/ssa-dse-19.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-20.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-21.c: Likewise.

From-SVN: r244442
2017-01-13 08:42:08 -07:00
Jeff Law 68b36e5903 re PR tree-optimization/33562 (aggregate DSE disabled)
PR tree-optimization/33562
	PR tree-optimization/61912
	PR tree-optimization/77485
	* sbitmap.h (bitmap_count_bits): Prototype.
	(bitmap_clear_range, bitmap_set_range): Likewise.
	* sbitmap.c (bitmap_clear_range): New function.
	(bitmap_set_range, sbitmap_popcount, bitmap_count_bits): Likewise.

From-SVN: r244441
2017-01-13 08:37:09 -07:00
Martin Liska 77719b0675 Reload global options when strict aliasing is dropped (PR ipa/79043).
2017-01-13  Martin Liska  <mliska@suse.cz>

	PR ipa/79043
	* function.c (set_cfun): Add new argument force.
	* function.h (set_cfun): Likewise.
	* ipa-inline-transform.c (inline_call): Use the function when
	strict alising from is dropped for function we inline to.
2017-01-13  Martin Liska  <mliska@suse.cz>

	PR ipa/79043
	* gcc.c-torture/execute/pr79043.c: New test.

From-SVN: r244435
2017-01-13 12:56:54 +00:00
Richard Biener 3d78845f1c tree-pretty-print.c (dump_generic_node): Fix inverted condition for dumping GIMPLE INTEGER_CSTs.
2017-01-13  Richard Biener  <rguenther@suse.de>

	* tree-pretty-print.c (dump_generic_node): Fix inverted condition
	for dumping GIMPLE INTEGER_CSTs.

From-SVN: r244433
2017-01-13 12:54:16 +00:00
Rainer Orth acd8b8dc7d Require C11 for C++17 on Solaris
* config/sol2.h (TARGET_OS_CPP_BUILTINS): Define __STDC_VERSION__
	to 201112L since C++17.

From-SVN: r244430
2017-01-13 12:11:00 +00:00
Maxim Ostapenko 0acd830b7e re PR sanitizer/78887 (Failure to build aarch64 allmodconfig Linux kernel 4.9)
PR sanitizer/78887
	* asan.c (asan_needs_odr_indicator_p): Don't emit ODR indicators
	if -fsanitize=kernel-address is present.

From-SVN: r244402
2017-01-13 12:08:50 +02:00
Richard Biener 2532991330 gimple-parser.c (c_parser_gimple_postfix_expression): Parse _Literal ( type-name ) number.
2017-01-13  Richard Biener  <rguenther@suse.de>

	c/
	* gimple-parser.c (c_parser_gimple_postfix_expression): Parse
	_Literal ( type-name ) number.

	* tree-pretty-print.c (dump_generic_node): Dump INTEGER_CSTs
	as _Literal ( type ) number in case usual suffixes do not
	preserve all information.

	* gcc.dg/gimplefe-22.c: New testcase.

From-SVN: r244393
2017-01-13 08:16:59 +00:00
Michael Meissner 59a505da6b re PR target/79004 (ICE in gcc.dg/torture/fp-int-convert-float128-ieee.c with -mcpu=power9)
[gcc]
2017-01-12  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79004
	* config/rs6000/rs6000.md (FP_ISA3): Do not optimize converting
	char or short to __float128/_Float128 directly.

[gcc/testsuite]
2017-01-12  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79004
	* gcc.target/powerpc/pr79004.c: New test.

From-SVN: r244386
2017-01-12 22:02:57 +00:00
Martin Sebor bce6f76013 (-Wformat-overflow): ...to this.
gcc/c-family/ChangeLog:

	(-Wformat-overflow): ...to this.

gcc/ChangeLog:

	to -Wformat-overflow.
	* gimple-ssa-sprintf.c (pass_sprintf_length::gate): Adjust.
	(min_bytes_remaining): Same.
	(get_string_length): Same.
	(format_string): Same.
	(format_directive): Same.
	(add_bytes): Same.
	(pass_sprintf_length::handle_gimple_call): Same.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr78138.c: Adjust.
	* gcc.dg/pr78768.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-4.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-2.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-4.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-6.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-7.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-8.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-9.c: Adjust.
	* gcc.dg/tree-ssa/pr78605.c: Adjust.
	* gcc.dg/tree-ssa/pr78622.c: Adjust.

From-SVN: r244385
2017-01-12 14:54:41 -07:00
Jakub Jelinek 3eefa646f4 gimple-ssa-sprintf.c (try_substitute_return_value): Remove info.nowrite calls with no lhs that can't throw.
* gimple-ssa-sprintf.c (try_substitute_return_value): Remove
	info.nowrite calls with no lhs that can't throw.  Return bool
	whether gsi_remove has been called or not.
	(pass_sprintf_length::handle_gimple_call): Return bool whether
	try_substitute_return_value called gsi_remove.  Formatting fix.
	(pass_sprintf_length::execute): Don't use gsi_remove if
	handle_gimple_call returned true.

	* gcc.dg/tree-ssa/builtin-snprintf-1.c: New test.

From-SVN: r244384
2017-01-12 22:30:56 +01:00
Jakub Jelinek b34f29a19d re PR bootstrap/79069 (Bootstrap failure on s390x-linux while building libgo)
PR bootstrap/79069
	* cfgrtl.c (rtl_tidy_fallthru_edge): For any_uncondjump_p that can't
	be removed due to side-effects, don't remove following barrier nor
	turn the successor edge into fallthru edge.

From-SVN: r244383
2017-01-12 22:29:43 +01:00
Bill Schmidt 6611316649 re PR target/79044 (ICE in insn_is_swappable_p, at config/rs6000/rs6000.c:41191)
[gcc]

2017-01-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/79044
	* config/rs6000/rs6000.c (insn_is_swappable_p): Mark
	element-reversing loads and stores as not swappable.

[gcc/testsuite]

2017-01-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/79044
	* gcc.target/powerpc/swaps-p8-26.c: New.

From-SVN: r244368
2017-01-12 16:01:13 +00:00
Nathan Sidwell 0691440320 combine.c (try_combine): Don't ignore result of overlap checking loop.
* combine.c (try_combine): Don't ignore result of overlap checking
	loop.  Combine overlap & asm check into single loop.

Co-Authored-By: Nicolai Stange <nicstange@gmail.com>

From-SVN: r244361
2017-01-12 13:54:43 +00:00
Richard Biener 6bb4ea5cdf tree-pretty-print.c (dump_generic_node): Provide -gimple variant for MEM_REF.
2017-01-12  Richard Biener  <rguenther@suse.de>

	* tree-pretty-print.c (dump_generic_node): Provide -gimple
	variant for MEM_REF.  Sanitize INTEGER_CST for -gimple.

	c/
	* gimple-parser.c (c_parser_gimple_postfix_expression): Parse
	__MEM.

	* gcc.dg/gimplefe-21.c: New testcase.

From-SVN: r244350
2017-01-12 08:33:09 +00:00
Richard Biener ef9d56f8ac tree.c (initialize_tree_contains_struct): Make TS_OPTIMIZATION and TS_TARGET_OPTION directly derive from TS_BASE.
2017-01-12  Richard Biener  <rguenther@suse.de>

	* tree.c (initialize_tree_contains_struct): Make TS_OPTIMIZATION
	and TS_TARGET_OPTION directly derive from TS_BASE.
	* tree-core.h (tree_optimization_option): Derive from tree_base.
	(tree_target_option): Likewise.

From-SVN: r244349
2017-01-12 08:13:43 +00:00
Uros Bizjak f69dacdae5 i386.c (memory_address_length): Increase len only when rip_relative_addr_p returns false.
* config/i386/i386.c (memory_address_length): Increase len
	only when rip_relative_addr_p returns false.

From-SVN: r244341
2017-01-11 22:53:45 +01:00
Julia Koval 73e32c4743 i386-common.c (OPTION_MASK_ISA_SGX_UNSET): New.
* common/config/i386/i386-common.c (OPTION_MASK_ISA_SGX_UNSET): New.
	(OPTION_MASK_ISA_SGX_SET): New.
	(ix86_handle_option): Handle OPT_msgx.
	* config.gcc: Added sgxintrin.h.
	* config/i386/driver-i386.c (host_detect_local_cpu): Detect sgx.
	* config/i386/i386-c.c (ix86_target_macros_internal): Define __SGX__.
	* config/i386/i386.c (ix86_target_string): Add -msgx.
	(PTA_SGX): New.
	(ix86_option_override_internal): Handle new options.
	(ix86_valid_target_attribute_inner_p): Add sgx.
	* config/i386/i386.h (TARGET_SGX, TARGET_SGX_P): New.
	* config/i386/i386.opt: Add msgx.
	* config/i386/sgxintrin.h: New file.
	* config/i386/x86intrin.h: Add sgxintrin.h.

testsuite/ChangeLog:

	* gcc.target/i386/sgx.c New test.
	* gcc.target/i386/sse-12.c: Add -msgx.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-14.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* g++.dg/other/i386-2.C: Ditto.
	* g++.dg/other/i386-3.C: Ditto.


Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>

From-SVN: r244339
2017-01-11 22:41:13 +01:00
Jakub Jelinek eae63d784c re PR c++/71537 (GCC rejects consetxpr boolean conversions and comparisons on the result of pointer arithmetic.)
PR c++/71537
	* fold-const.c (maybe_nonzero_address): Return 1 for function
	local objects.
	(tree_single_nonzero_warnv_p): Don't handle function local objects
	here.

	* g++.dg/cpp1y/constexpr-71537.C: New test.

From-SVN: r244333
2017-01-11 21:10:36 +01:00
Jakub Jelinek 6b5b4e9cec re PR c++/72813 (atomic header cannot be compiled into translation unit with -fkeep-inline-functions)
PR c++/72813
	* gcc.c (default_compilers): Don't add -o %g.s for -S -save-temps
	of c-header.

	* c-decl.c (pop_file_scope): Set flag_syntax_only to 1 after writing
	PCH file.

	* decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
	writing PCH file.

From-SVN: r244328
2017-01-11 19:08:57 +01:00
David Malcolm 19ff0049cd Offer suggestions for unrecognized sanitizer options (PR driver/78877)
gcc/ChangeLog:
	PR driver/78877
	* opts.c: Include "spellcheck.h"
	(struct string_fragment): New struct.
	(struct edit_distance_traits<const string_fragment &>): New
	struct.
	(get_closest_sanitizer_option): New function.
	(parse_sanitizer_options): Offer suggestions for unrecognized arguments.

gcc/testsuite/ChangeLog:
	PR driver/78877
	* gcc.dg/spellcheck-options-14.c: New test case.
	* gcc.dg/spellcheck-options-15.c: New test case.
	* gcc.dg/spellcheck-options-16.c: New test case.
	* gcc.dg/spellcheck-options-17.c: New test case.

From-SVN: r244325
2017-01-11 17:25:40 +00:00