Commit Graph

29827 Commits

Author SHA1 Message Date
Jakub Jelinek 760f82dbb7 re PR rtl-optimization/79901 (ICE in prepare_cmp_insn, at optabs.c:3904)
PR rtl-optimization/79901
	* config/i386/sse.md (*avx512bw_<code><mode>3<mask_name>): Renamed to
	...
	(*avx512f_<code><mode>3<mask_name>): ... this.
	(<code><mode>3 with maxmin code iterator): Use VI8_AVX2_AVX512F
	iterator instead of VI8_AVX2_AVX512BW.

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

From-SVN: r245947
2017-03-07 09:11:30 +01:00
Jakub Jelinek 1f6dba54da re PR sanitizer/79897 (ICE in gimplify_modify_expr, at gimplify.c:5627 on ARM target)
PR sanitizer/79897
	* ubsan.c (ubsan_encode_value): Call mark_addressable on the
	temporary.

	* c-c++-common/ubsan/pr79897.c: New test.

From-SVN: r245945
2017-03-07 07:11:14 +01:00
Vladimir Makarov feca7b8954 re PR rtl-optimization/79571 (ICE in Max. number of generated reload insns per insn is achieved (90))
2017-03-06  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/79571
	* lra-constraints.c (process_alt_operands): Claculate static
	reject and subtract it from overal when there will be only address
	reloads.

2017-03-06  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/79571
	* gcc.target/i386/pr79571.c: New.

From-SVN: r245928
2017-03-06 20:23:00 +00:00
Marek Polacek bdbbf28d15 PR c++/79796 - ICE with NSDMI and this pointer
PR c++/79796 - ICE with NSDMI and this pointer
	* call.c (build_over_call): Handle NSDMI with a 'this' by calling
	replace_placeholders.

	* g++.dg/cpp0x/nsdmi13.C: New test.

From-SVN: r245927
2017-03-06 17:38:42 +00:00
Julia Koval 52564551d3 Set incoming stack boundary to 128 for 64-bit targets
For 64-bit targets, the incoming stack of interrupt handler is aligned
to 16 bytes.  Update ix86_minimum_incoming_stack_boundary to set the
incoming stack boundary of interrupt handler to 128 for 64-bit targets.

gcc/

2017-03-06  Julia Koval  <julia.koval@intel.com>

	PR target/79793
	* config/i386/i386.c (ix86_minimum_incoming_stack_boundary): Set
	incoming stack boundary to 128 for 64-bit targets.

gcc/testsuite/

2017-03-06  Julia Koval  <julia.koval@intel.com>

	PR target/79793
	 * gcc.target/i386/interrupt-12.c: Update scan-assembler-times
	 directives.
	 * gcc.target/i386/interrupt-13.c: Ditto.
	 * gcc.target/i386/interrupt-14.c: Ditto.
	 * gcc.target/i386/interrupt-15.c: Ditto.

From-SVN: r245926
2017-03-06 08:08:59 -08:00
Jakub Jelinek 345edb3701 re PR c++/79822 (ICE with void statement expression)
PR c++/79822
	* constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
	({ (void) 0; }).

	* g++.dg/cpp0x/constexpr-79822.C: New test.

From-SVN: r245925
2017-03-06 16:43:51 +01:00
Richard Biener a8d25fd0dd re PR tree-optimization/79887 (ICE in set_uid_loop_bbs, at tree-vectorizer.c:482)
2017-03-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79894
	* tree-vectorizer.c (vectorize_loops): Set loop_vectorized_call
	to NULL after folding it.

	* gcc.dg/vect/pr79887.c: New testcase.

From-SVN: r245923
2017-03-06 13:58:57 +00:00
Richard Biener 522fcdd739 re PR tree-optimization/79824 (Failure to peel for gaps leads to read beyond mapped memory)
2017-03-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79824
	* tree-vect-stmts.c (get_group_load_store_type): Fix alignment
	check disabling peeling for gaps.

	* gcc.dg/vect/pr79824-1.c: New testcase.
	* gcc.dg/vect/pr79824-2.c: Likewise.

From-SVN: r245922
2017-03-06 13:58:01 +00:00
Toma Tabacu 5464963112 Add check_effective_target_gettimeofday and use it in gcc.dg/lto/pr60449_0.c.
gcc/
	* doc/sourcebuild.texi (Effective-Target Keywords, Environment
	attributes): Document gettimeofday.

gcc/testsuite/

	* gcc.dg/lto/pr60449_0.c: Add dg-require-effective-target for
	gettimeofday.  Remove dg-skip-if for AVR.
	* lib/target-supports.exp (check_effective_target_gettimeofday):
	New proc.

From-SVN: r245921
2017-03-06 13:15:30 +00:00
Robin Dapp 4bbc897068 S/390: Change 2-byte NOPs
The following patch changes "nopr %r7" to "nopr %r0" which is
advantageous from a hardware perspective. It will only be emitted for
hotpatching and should not impact normal code.

gcc/ChangeLog:

2017-03-06  Robin Dapp  <rdapp@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_asm_output_function_label): Use nopr %r0.
	* config/s390/s390.md: Likewise.

gcc/testsuite/ChangeLog:

2017-03-06  Robin Dapp  <rdapp@linux.vnet.ibm.com>

	* gcc.target/s390/hotpatch-1.c: Check for nopr %r0.
	* gcc.target/s390/hotpatch-10.c: Likewise.
	* gcc.target/s390/hotpatch-11.c: Likewise.
	* gcc.target/s390/hotpatch-12.c: Likewise.
	* gcc.target/s390/hotpatch-13.c: Likewise.
	* gcc.target/s390/hotpatch-14.c: Likewise.
	* gcc.target/s390/hotpatch-15.c: Likewise.
	* gcc.target/s390/hotpatch-16.c: Likewise.
	* gcc.target/s390/hotpatch-17.c: Likewise.
	* gcc.target/s390/hotpatch-18.c: Likewise.
	* gcc.target/s390/hotpatch-19.c: Likewise.
	* gcc.target/s390/hotpatch-2.c: Likewise.
	* gcc.target/s390/hotpatch-26.c: Likewise.
	* gcc.target/s390/hotpatch-27.c: Likewise.
	* gcc.target/s390/hotpatch-28.c: Likewise.
	* gcc.target/s390/hotpatch-3.c: Likewise.
	* gcc.target/s390/hotpatch-4.c: Likewise.
	* gcc.target/s390/hotpatch-5.c: Likewise.
	* gcc.target/s390/hotpatch-6.c: Likewise.
	* gcc.target/s390/hotpatch-7.c: Likewise.
	* gcc.target/s390/hotpatch-8.c: Likewise.
	* gcc.target/s390/hotpatch-9.c: Likewise.

From-SVN: r245917
2017-03-06 12:40:19 +00:00
Paolo Carlini 5f215a70ba re PR c++/64574 (ICE (stack overflow SEGV) with bad template specialization)
2017-03-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/64574
	* g++.dg/template/crash125.C: New.

From-SVN: r245916
2017-03-06 11:54:37 +00:00
Jakub Jelinek 296cc393ef re PR target/79812 (ICE in simplify_binary_operation_1, at simplify-rtx.c:3586)
PR target/79812
	* config/i386/sse.md (VI8F_256_512): Remove mode iterator.
	(<avx2_avx512>_perm<mode>): Rename to ...
	(avx2_perm<mode>): ... this.  Use VI8F_256 iterator instead
	of VI8F_256_512.
	(<avx512>_perm<mode>_mask): Rename to ...
	(avx512vl_perm<mode>_mask): ... this.  Use VI8F_256 iterator instead
	of VI8F_256_512.
	(<avx2_avx512>_perm<mode>_1<mask_name>): Rename to ...
	(avx2_perm<mode>_1<mask_name): ... this.  Use VI8F_256 iterator
	instead of VI8F_256_512.
	(avx512f_perm<mode>): New define_expand.
	(avx512f_perm<mode>_mask): Likewise.
	(avx512f_perm<mode>_1<mask_name>): New define_insn.
	(<avx512>_vec_dup<mode>_1): Fix up vec_select mode.

	* gcc.target/i386/avx512f-vpermq-imm-3.c: New test.

From-SVN: r245915
2017-03-06 12:35:58 +01:00
Toma Tabacu ca8942a34a MIPS: Force o32 ABI for inline-memcpy-3.c.
gcc/testsuite/

	* gcc.target/mips/inline-memcpy-3.c (dg-options): Add -mabi=32.

From-SVN: r245914
2017-03-06 11:27:07 +00:00
Prachi Godbole c1b993c0a6 mips-msa.md (msa_fmax_a_<msafmt>, [...]): Introduce mode interator for if_then_else.
gcc/
	* config/mips/mips-msa.md (msa_fmax_a_<msafmt>, msa_fmin_a_<msafmt>,
	msa_max_a_<msafmt>, msa_min_a_<msafmt>): Introduce mode interator for
	if_then_else.
	(smin<mode>3, smax<mode>3): Change operand print code from 'B' to 'E'.

gcc/testsuite/
	* gcc.target/mips/msa-minmax.c: New tests.

From-SVN: r245913
2017-03-06 10:32:47 +00:00
Martin Liska a50a32aa3c Fix ICE in use-after-scope w/ -fno-tree-dce (PR sanitize/79783).
2017-03-06  Martin Liska  <mliska@suse.cz>

	PR sanitize/79783
	* asan.c (asan_expand_poison_ifn): Do not expand ASAN_POISON
	when having a SSA NAME w/o VAR_DECL assigned to it.
2017-03-06  Martin Liska  <mliska@suse.cz>

	PR sanitize/79783
	* g++.dg/asan/pr79783.C: New test.

From-SVN: r245912
2017-03-06 10:20:33 +00:00
Prachi Godbole 5ada812ced mips-msa.md (msa_dotp_<su>_d, [...]): Fix MODE for vec_select.
gcc/
	* config/mips/mips-msa.md (msa_dotp_<su>_d, msa_dpadd_<su>_d,
	msa_dpsub_<su>_d): Fix MODE for vec_select.

gcc/testsuite/
	* gcc.target/mips/msa-dotp.c: New tests.

From-SVN: r245911
2017-03-06 10:19:52 +00:00
Prachi Godbole 334b3c4b84 mips.c (mips_gen_const_int_vector): Change type of last argument.
gcc/
	* config/mips/mips.c (mips_gen_const_int_vector): Change type of last
	argument.
	* config/mips/mips-protos.h (mips_gen_const_int_vector): Likewise.

gcc/testsuite/
	* gcc.target/mips/msa-bclri.c: New test.

From-SVN: r245910
2017-03-06 10:08:51 +00:00
Paolo Carlini d8b4baeb45 re PR c++/70266 (ICE on invalid code on x86_64-linux-gnu: unexpected expression ‘foo’ of kind overload)
/cp
2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/70266
	* except.c (build_must_not_throw_expr): Perform the implicit
	conversions on the condition.

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

	PR c++/70266
	* g++.dg/tm/pr70266.C: New.

From-SVN: r245901
2017-03-05 17:13:16 +00:00
Andre Vehreschild ef78bc3c0b check.c (positive_check): Add new function checking constant for being greater then zero.
gcc/fortran/ChangeLog:

2017-03-05  Andre Vehreschild  <vehre@gcc.gnu.org>
            Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>

	* check.c (positive_check): Add new function checking constant for
	being greater then zero.
	(gfc_check_image_status): Add checking of image_status arguments.
	(gfc_check_failed_or_stopped_images): Same but for failed_- and
	stopped_images function.
	* dump-parse-tree.c (show_code_node): Added output of FAIL IMAGE.
	* gfortran.h (enum gfc_statement): Added FAIL_IMAGE_ST.
	(enum gfc_isym_id): Added new intrinsic symbols.
	(enum gfc_exec_op): Added EXEC_FAIL_IMAGE.
	* gfortran.texi: Added description for the new API functions. Updated
	coverage of gfortran of TS18508.
	* intrinsic.c (add_functions): Added symbols to resolve new intrinsic
	functions. 
	* intrinsic.h: Added prototypes.
	* iresolve.c (gfc_resolve_failed_images): Resolve the failed_images
	intrinsic.
	(gfc_resolve_image_status): Same for image_status.
	(gfc_resolve_stopped_images): Same for stopped_images.
	* libgfortran.h: Added prototypes.
	* match.c (gfc_match_if): Added matching of FAIL IMAGE statement.
	(gfc_match_fail_image): Match a FAIL IMAGE statement.
	* match.h: Added prototype.
	* parse.c (decode_statement): Added matching for FAIL IMAGE.
	(next_statement): Same.
	(gfc_ascii_statement): Same.
	* resolve.c: Same.
	* simplify.c (gfc_simplify_failed_or_stopped_images): For COARRAY=
	single a constant result can be returne.d
	(gfc_simplify_image_status): For COARRAY=single the result is constant.
	* st.c (gfc_free_statement): Added FAIL_IMAGE handling.
	* trans-decl.c (gfc_build_builtin_function_decls): Added decls of the
	new intrinsics.
	* trans-expr.c (gfc_conv_procedure_call): This is first time all
	arguments of a function are optional, which is now handled here
	correctly.
	* trans-intrinsic.c (conv_intrinsic_image_status): Translate
	image_status.
	(gfc_conv_intrinsic_function): Add support for image_status.
	(gfc_is_intrinsic_libcall): Add support for the remaining new
	intrinsics.
	* trans-stmt.c (gfc_trans_fail_image): Trans a fail image.
	* trans-stmt.h: Add the prototype for the above.
	* trans.c (trans_code): Dispatch for fail_image.
	* trans.h: Add the trees for the new intrinsics.

libgfortran/ChangeLog:

2017-03-05  Andre Vehreschild  <vehre@gcc.gnu.org>
            Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>

	* caf/libcaf.h: Added prototypes and stat codes for failed and stopped
	images.
	* caf/single.c (void _gfortran_caf_fail_image): Add the routine.
	(int _gfortran_caf_image_status): Same.
	(_gfortran_caf_failed_images): Same.
	(_gfortran_caf_stopped_images): Same.


gcc/testsuite/ChangeLog:

2017-03-05  Andre Vehreschild  <vehre@gcc.gnu.org>
            Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>

	* gfortran.dg/coarray/fail_image_1.f08: New test.
	* gfortran.dg/coarray/fail_image_2.f08: New test.
	* gfortran.dg/coarray/failed_images_1.f08: New test.
	* gfortran.dg/coarray/failed_images_2.f08: New test.
	* gfortran.dg/coarray/image_status_1.f08: New test.
	* gfortran.dg/coarray/image_status_2.f08: New test.
	* gfortran.dg/coarray/stopped_images_1.f08: New test.
	* gfortran.dg/coarray/stopped_images_2.f08: New test.
	* gfortran.dg/coarray_fail_st.f90: New test.
	* gfortran.dg/coarray_failed_images_1.f08: New test.
	* gfortran.dg/coarray_image_status_1.f08: New test.
	* gfortran.dg/coarray_stopped_images_1.f08: New test.

From-SVN: r245900
2017-03-05 12:35:47 +01:00
Marek Polacek 7f5a7d7848 re PR c/79758 (ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in store_parm_decls_oldstyle, at c/c-decl.c:8973)
PR c/79758
	* c-decl.c (store_parm_decls_oldstyle): Check if the element of
	current_function_prototype_arg_types is error_mark_node.  Fix
	formatting.  Use TREE_VALUE instead of TREE_TYPE.

	* gcc.dg/noncompile/pr79758.c: New test.

From-SVN: r245886
2017-03-03 22:19:24 +00:00
Jakub Jelinek cc195d46a3 re PR middle-end/79805 (ICE (verify_flow_info failed) with -fnon-call-exceptions -O)
PR middle-end/79805
	* internal-fn.def (ATOMIC_BIT_TEST_AND_SET, ATOMIC_BIT_TEST_AND_RESET,
	ATOMIC_BIT_TEST_AND_COMPLEMENT, ATOMIC_COMPARE_EXCHANGE): Remove
	ECF_NOTHROW.
	* gimple-fold.c (fold_builtin_atomic_compare_exchange): Set
	gimple_call_nothrow_p flag based on whether original builtin can throw.
	If it can, emit following stmts on the fallthrough edge.
	* tree-ssa-ccp.c (optimize_atomic_bit_test_and): Similarly, except
	don't create new bb if inserting just debug stmts on the edge, try to
	insert them on the fallthru bb or just reset debug stmts.

	* g++.dg/opt/pr79805.C: New test.

From-SVN: r245882
2017-03-03 20:32:01 +01:00
Andrew Senkevich 945b6e16e2 avx512vpopcntdq-check.h: New.
* gcc.target/i386/avx512vpopcntdq-check.h: New.
	* gcc.target/i386/avx512vpopcntdq-vpopcntd-1.c: Ditto.
	* gcc.target/i386/avx512vpopcntdq-vpopcntq-1.c: Ditto.
	* gcc.target/i386/avx512f-helper.h: Add avx512vpopcntdq-check.h.
	* gcc.target/i386/i386.exp
	(check_effective_target_avx512vpopcntdq): New.

From-SVN: r245879
2017-03-03 17:55:31 +01:00
Toma Tabacu 31dcc38568 MIPS: Fix register mode checking for n64 in pr68273.c.
gcc/testsuite/

	* gcc.target/mips/pr68273.c (dg-final): Match SImode registers only for
	ilp32 targets and match DImode registers for lp64 targets.

From-SVN: r245874
2017-03-03 13:23:53 +00:00
Uros Bizjak 0e174ae195 pr71624.C: Disable for x32.
* g++.dg/pr71624.C: Disable for x32.
	* g++.dg/pr71633.C: Ditto.

From-SVN: r245872
2017-03-03 13:26:16 +01:00
Jakub Jelinek 93505ec51e re PR target/79807 (ICE in extract_insn, at recog.c:2311 (error: unrecognizable insn))
PR target/79807
	* config/i386/i386.c (ix86_expand_multi_arg_builtin): If target
	is a memory operand, increase num_memory.
	(ix86_expand_args_builtin): Likewise.

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

From-SVN: r245871
2017-03-03 13:24:53 +01:00
Martin Liska d78a1c01db Add -Wdisabled-optimization to loop prefetching pass (PR tree-optimization/79803).
2017-03-03  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/79803
	* tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Remove
	assert.
	(pass_loop_prefetch::execute): Disabled optimization if an
	assumption about L1 cache size is not met.
2017-03-03  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/79803
	* gcc.dg/tree-ssa/pr79803.c: New test.

From-SVN: r245869
2017-03-03 11:53:56 +00:00
Martin Liska ec7f796e87 GCSE: Use HOST_WIDE_INT instead of int (PR rtl-optimization/79574).
2017-03-03  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/79574
	* gcse.c (struct gcse_expr): Use HOST_WIDE_INT instead of int.
	(hash_scan_set): Likewise.
	(dump_hash_table): Likewise.
	(hoist_code): Likewise.
2017-03-03  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/79574
	* gcc.dg/pr79574-2.c: New test.

From-SVN: r245868
2017-03-03 11:53:14 +00:00
Richard Biener 30d309aaf1 re PR c++/79825 (Uninitialized uses in aggregate copies of empty structs (missed DCE in C++ gimplify))
2017-03-03  Richard Biener  <rguenther@suse.de>

	PR c++/79825
	* cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.

	* g++.dg/warn/Wuninitialized-8.C: New testcase.

From-SVN: r245866
2017-03-03 11:30:32 +00:00
Jakub Jelinek 38801de50f * gcc.dg/pr57134.c: Use empty inline asm string literal.
From-SVN: r245865
2017-03-03 11:41:49 +01:00
Marek Polacek 7278b0a266 re PR c++/79791 (-Werror=write-strings ignored with -Wpedantic)
PR c++/79791
	* typeck.c (string_conv_p): In C++11, always call pedwarn with
	OPT_Wwrite_strings.

	* g++.dg/warn/Wwrite-strings-1.C: New test.
	* g++.dg/warn/Wwrite-strings-2.C: New test.
	* g++.dg/warn/Wwrite-strings-3.C: New test.
	* g++.dg/warn/Wwrite-strings-4.C: New test.
	* g++.dg/warn/Wwrite-strings-5.C: New test.
	* g++.dg/warn/Wwrite-strings-6.C: New test.
	* g++.dg/warn/Wwrite-strings-7.C: New test.
	* g++.dg/warn/Wwrite-strings-8.C: New test.
	* g++.dg/warn/Wwrite-strings-9.C: New test.
	* g++.dg/warn/Wwrite-strings-10.C: New test.
	* g++.dg/warn/Wwrite-strings-11.C: New test.
	* g++.dg/warn/Wwrite-strings-12.C: New test.

From-SVN: r245864
2017-03-03 09:58:10 +00:00
Richard Biener 75473a91bc re PR middle-end/79818 (wrong code with -fwrapv and -Os/-O1/-O2/-O3)
2017-03-03  Richard Biener  <rguenther@suse.de>

	PR middle-end/79818
	* match.pd ( X +- C1 CMP C2 -> X CMP C2 -+ C1): Add missing
	TYPE_OVERFLOW_UNDEFINED check.

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

From-SVN: r245860
2017-03-03 08:08:08 +00:00
Jakub Jelinek 50bea0c5ea re PR c++/79782 (ICE: tree check: expected tree_list, have void_type in emit_mem_initializers, at cp/init.c:1225)
PR c++/79782
	* init.c (mark_exp_read_r): New function.
	(emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
	whole arguments instead of plain mark_exp_read on TREE_LIST values.

	* g++.dg/warn/Wunused-parm-10.C: New test.

From-SVN: r245853
2017-03-02 22:31:40 +01:00
Uros Bizjak 130f15ce27 *.c: Test for "{ i?86-*-* x86_64-*-* } && lp64" targets only.
* gcc.dg/rtl/x86_64/*.c: Test for
	"{ i?86-*-* x86_64-*-* } && lp64" targets only.

From-SVN: r245850
2017-03-02 20:32:32 +01:00
Uros Bizjak dc362ada54 re PR target/79514 (ICE in curr_insn_transform, at lra-constraints.c:3773)
PR target/79514
	* config/i386/i386.md (*pushxf_rounded): New insn_and_split pattern.

testsuite/ChangeLog:

	PR target/79514
	* gcc.target/i386/pr79514.c: New test.

From-SVN: r245844
2017-03-02 19:47:03 +01:00
Jakub Jelinek fe792dd82f re PR rtl-optimization/79780 (ICE in rtl_verify_bb_insns, at cfgrtl.c:2661 (error: flow control insn inside a basic block))
PR rtl-optimization/79780
	* cprop.c (one_cprop_pass): When second and further conditional trap
	in a single basic block is turned into an unconditional trap, turn it
	into a deleted note to avoid RTL verification failures.

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

From-SVN: r245843
2017-03-02 17:02:37 +01:00
Richard Biener e80facb4af re PR tree-optimization/79345 (passing yet-uninitialized member as argument to base class constructor should warn (-Wunitialized))
2017-03-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79345
	PR c++/42000
	* tree-ssa-alias.c (walk_aliased_vdefs_1): Take a limit
	param and abort the walk, returning -1 if it is hit.
	(walk_aliased_vdefs): Take a limit param and pass it on.
	* tree-ssa-alias.h (walk_aliased_vdefs): Add a limit param,
	defaulting to 0 and return a signed int.
	* tree-ssa-uninit.c (struct check_defs_data): New struct.
	(check_defs): New helper.
	(warn_uninitialized_vars): Use walk_aliased_vdefs to warn
	about uninitialized memory.

	* fixed-value.c (fixed_from_string): Use ulow/uhigh to avoid
	bogus uninitialized warning.
	(fixed_convert_from_real): Likewise.

	* g++.dg/warn/Wuninitialized-7.C: New testcase.
	* c-c++-common/ubsan/bounds-2.c: Add -Wno-uninitialized.
	* gcc.dg/uninit-pr19430-2.c: Add expected warning.

From-SVN: r245840
2017-03-02 13:42:05 +00:00
Richard Biener eb0e7c34d7 re PR middle-end/79756 (ICE in execute_todo, at passes.c:2011)
2017-03-02  Richard Biener  <rguenther@suse.de>

	PR c/79756
	* c-common.c (c_common_mark_addressable_vec): Look through
	C_MAYBE_CONST_EXPR.

	* gcc.dg/vector-1.c: New testcase.

From-SVN: r245838
2017-03-02 11:44:16 +00:00
Bin Cheng 653a4b32fe re PR tree-optimization/66768 (address space gets lost on literal pointer)
PR tree-optimization/66768
	* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Skip addr
	iv_use if base object can't be determined.

	gcc/testsuite
	* gcc.target/i386/pr66768.c: New test.

From-SVN: r245837
2017-03-02 11:25:11 +00:00
Richard Biener da403f3178 dfinit.c: Only run for lp64.
2017-03-02  Richard Biener  <rguenther@suse.de>

	* gcc.dg/rtl/x86_64/dfinit.c: Only run for lp64.
	* gcc.dg/rtl/x86_64/final.c: Likewise.
	* gcc.dg/rtl/x86_64/into-cfglayout.c: Likewise.
	* gcc.dg/rtl/x86_64/ira.c: Likewise.
	* gcc.dg/rtl/x86_64/times-two.c.after-expand.c: Likewise.
	* gcc.dg/rtl/x86_64/vregs.c: Likewise.

From-SVN: r245832
2017-03-02 08:20:19 +00:00
Richard Biener 83692f9662 re PR tree-optimization/79777 (ICE on -Os and above in on aarch64-linux-gnu (internal compiler error: in VN_INFO_GET, at tree-ssa-sccvn.c:407 }))
2017-03-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79777
	* tree-ssa-pre.c (eliminate_insert): Give up if we simplify
	the to insert expression to sth existing.

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

From-SVN: r245830
2017-03-02 07:53:42 +00:00
Martin Sebor 71dedb336f PR middle-end/79692 - [7 Regression] -Wformat-overflow false positive
gcc/ChangeLog:

	PR middle-end/79692
	* gimple-ssa-sprintf.c
	(directive::known_width_and_precision): New function.
	(format_integer): Use it.
	(get_mpfr_format_length): Consider the full range of precision
	when computing %g output with the # flag.  Set the likely byte
	count to 3 rather than 1 when precision is indeterminate.
	(format_floating): Correct the lower bound of precision.

gcc/testsuite/ChangeLog:

	PR middle-end/79692
	* gcc.dg/tree-ssa/builtin-sprintf-2.c: Add test cases.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: Correct %#g.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-15.c: New test.
	* gcc.dg/tree-ssa/builtin-snprintf-3.c: Ditto.

From-SVN: r245822
2017-03-01 16:39:59 -07:00
Uros Bizjak 489909059b i386.c (print_reg): Warn for values of unsupported size in integer register.
* config/i386/i386.c (print_reg): Warn for values of
	unsupported size in integer register.

testsuite/ChangeLog:

	* gcc.target/i386/invsize-2.c: New test.
	* gcc.target/i386/invsize-3.c: Ditto.
	* gcc.target/i386/invsize-4.c: Ditto.
	* gcc.target/i386/pr66274.c: Expect "unsuported size" warning.
	* gcc.target/i386/stackalign/asm-1.c: Ditto.

From-SVN: r245815
2017-03-01 20:24:53 +01:00
Michael Meissner c7f0c9f34f re PR target/79439 (Missing nop instruction after recursive call corrupts TOC register)
[gcc]
2017-03-01  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79439
	* config/rs6000/predicates.md (current_file_function_operand): Do
	not allow self calls to be local if the function is replaceable.

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

	PR target/79439
	* gcc.target/powerpc/pr79439.c: New test.

From-SVN: r245813
2017-03-01 18:33:21 +00:00
Pat Haugen f5ef6bfc30 pr79544.c: Add test for vec_vsrad and fix up scan string.
* gcc.target/powerpc/pr79544.c: Add test for vec_vsrad and fix up
	scan string.

From-SVN: r245812
2017-03-01 18:09:51 +00:00
Kelvin Nilsen 501815065b re PR target/79395 (Compile error with -mcpu=power9 and __builtin_vec_vcmpne_p)
gcc/ChangeLog:

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

	PR target/79395
	* config/rs6000/altivec.h (vec_ctz and others): Change the
	preprocessor macro that controls conditional compilation from
	_ARCH_PWR9 to __POWER9_VECTOR__.
	(vec_all_ne): Change parameterization of __altivec_scalar_pred
	macro expansion under preprocessor #ifdef __POWER9_VECTOR__
	control (instead of _ARCH_PWR9 control) so that template
	definition uses power9-specific function.
	(vec_any_eq): Likewise.
	(vec_all_ne): Change macro definition to use a power9-specific
	expansion under #ifdef __POWER9_VECTOR__ control (instead of
	_ARCH_PWR9 control).
	(vec_any_eq) Likewise.
	* config/rs6000/rs6000-builtin.def (CMPNEF): Remove BU_P9V_AV_2
	expansion for CMPNEF to remove support for xvcmpnesp instruction.
	(CMPNED): Remove BU_P9V_AV2 expansion for CMPNED to remove
	support for xvcmpnedp instruction.
	(VCMPNEB_P): Replace BU_P9V_AV_P macro expansion with BU_P9V_AV_2
	macro expansion so that Power9 implementation of vec_all_ne does
	not use the AltiVec predicate framework.
	(VCMPNEH_P): Likewise.
	(VCMPNEW_P): Likewise.
	(VCMPNED_P): Likewise.
	(VCMPNEFP_P): Likewise.
	(VCMPNEDP_P): Likewise.
	(VCMPAEB_P): Add BU_P9V_AV_2 macro expansion to change
	implementation of vec_any_eq to not use AltiVec predicate
	framework.
	(VCMPAEH_P): Likewise.
	(VCMPAEW_P): Likewise.
	(VCMPAED_P): Likewise.
	(VCMPAEFP_P): Likewise.
	(VCMPAEDP_P): Likewise.
	(VCMPNE_P): Replace BU_P9V_OVERLOAD_P macro expansion with
	BU_P9V_OVERLOAD_2 so that Power9 implementation of vec_all_ne does
	not use the AltiVec predicate framework.
	(VCMPAE_P): Add BU_P9V_OVERLOAD_2 macro to change implementation
	of vec_any_eq to not use AltiVec predicate framework.
	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Add
	support for predefined __POWER9_VECTOR__ macro to indicate that
	Power9 instruction selection is enabled.
	(altivec_overloaded_builtins): Remove extraneous
	ALTIVEC_BUILTIN_VEC_CMPNE entry for overloaded
	function argument types RS6000_BTI_bool_V16QI and
	RS6000_BTI_bool_V16QI.  Remove erroneous ALTIVEC_BUILTIN_VEC_CMPNE
	entry for overloaded function argument types RS6000_BTI_bool_V4SI
	andRS6000_BTI_bool_V4SI, mapping to P9V_BUILTIN_CMPNEB.  Remove
	two entries mapping to P9V_BUITIN_CMPNED and one entry mapping to
	P9V_BUILTIN_CMPNEF to force use of instructions not specific to
	Power9 for implementations of vec_cmpne.  Change the signature for
	all definitions of the overloaded P9V_BUILTIN_VEC_CMPNE_P function
	(representing vec_all_ne) to remove the previously described first
	argument of type RS6000_BTI_INTSI, as this was an artifact of
	reliance on the AltiVec predicate framework, which is no longer
	used in the implementation of these functions.  Add
	P9V_BUILTIN_VEC_VCMPAE_P entries (representing the vec_anyeq
	function) to match all of the P9V_BUILTIN_VEC_VCMNE_P entries
	since, unlike the AltiVec predicate framework implementation, we
	do not share function descriptors between vec_alle and vec_anyeq.
	(altivec_resolve_overloaded_builtin): Add SFmode and DFmode to the
	set of modes that receive special treatment even when
	TARGET_P9_VECTOR is true.  The special treatment emits code that
	does not depend on Power9 instructions.
	* config/rs6000/vector.md (vector_ne_<mode>_p): Change this
	define_expand to not rely on AltiVec predicate framework.
	(vector_ae_<mode>p): New define_expand to represent vec_any_eq
	function.
	(vector_ne_v2di_p): Change this define_expand to not rely on
	AltiVec predicate framework.
	(vector_ae_v2di_p): New define_expand to represent vec_any_eq
	function.
	(vector_ne_<mode>_p): Change this define_expand to not rely on
	AltiVec predicate framework.
	(vector_ae_<mode>p): New define_expand to represent vec_any_eq
	function.
	* config/rs6000/vsx.md (*vsx_ne_<mode>_p): For modes VSX_EXTRACT_I
	(V16QI, V8HI, V4SI), correct a typo in the code emitted for this
	define_insn pattern.
	(*vsx_ne_<mode>_p): For modes VSX_F (V4SF and V2DF), remove this
	define_insn pattern because the xvcmpne<VSs>. instruction is not
	supported.
	(vcmpne<VSs>): Remove this define_insn because xvcmpne<VSs>
	instruction is not supported.

gcc/testsuite/ChangeLog:

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

	PR target/79395
	* gcc.target/powerpc/vsu/vec-all-ne-10.c: Change scan-assembler
	pattern to look for vcmpequd. instead of vcmpnew.
	* gcc.target/powerpc/vsu/vec-all-ne-14.c: Likewise.
	* gcc.target/powerpc/vsu/vec-all-ne-7.c: Change scan-assembler
	pattern to look for xvcmpeqsp. instead of xvcmpnesp.
	* gcc.target/powerpc/vsu/vec-all-ne-8.c: Change scan-assembler to
	look for xvcmpeqdp. instead of xvcmpnedp.
	* gcc.target/powerpc/vsu/vec-all-ne-9.c: Change scan-assembler to
	look for vcmpequd. instead of vcmpnew.
	* gcc.target/powerpc/vsu/vec-any-eq-10.c: Likewise.
	* gcc.target/powerpc/vsu/vec-any-eq-14.c: Likewise.
	* gcc.target/powerpc/vsu/vec-any-eq-7.c: Change scan-assembler to
	look for xvcmpeqsp. instead of xvcmpnesp.
	* gcc.target/powerpc/vsu/vec-any-eq-8.c: Change scan-assembler to
	look for xvcmpeqdp. instead of xvcmpnedp.
	* gcc.target/powerpc/vsu/vec-any-eq-9.c: Change scan-assembler to
	look for vcmpequd. instead of vcmpnew.
	* gcc.target/powerpc/vsu/vec-cmpne-8.c: Change scan-assembler to
	look for vcmpeqsp instead of xvcmpnesp.
	* gcc.target/powerpc/vsu/vec-cmpne-9.c: Change scan-assembler to
	look for xvcmpeqdp instead of xvcmpnedp.

From-SVN: r245811
2017-03-01 14:43:02 +00:00
Jakub Jelinek 42132674e5 re PR c++/79681 (ICE with constexpr and bitfield)
PR c++/79681
	* fold-const.c (make_bit_field_ref): If orig_inner is COMPONENT_REF,
	attempt to use its first operand as BIT_FIELD_REF base.

	* g++.dg/cpp1y/constexpr-79681-1.C: New test.
	* g++.dg/cpp1y/constexpr-79681-2.C: New test.

From-SVN: r245804
2017-03-01 10:02:12 +01:00
Richard Biener 0100ae4302 re PR tree-optimization/79721 (Scalar evolution introduces signed overflow)
2017-03-01  Richard Biener  <rguenther@suse.de>

	PR middle-end/79721
	* tree-chrec.c (chrec_evaluate): Perform computation of Newtons
	interpolating formula in wrapping arithmetic.
	(chrec_apply): Convert chrec_evaluate return value to wanted type.

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

From-SVN: r245803
2017-03-01 08:54:29 +00:00
Jakub Jelinek e3e9e8ca83 re PR c++/79746 (Confusing -Wunused-but-set-parameter warning with virtual inheritance)
PR c++/79746
	* init.c (emit_mem_initializers): When not constructing vbases of
	abstract classes, mark arguments as read for
	-Wunused-but-set-parameter.

	* g++.dg/warn/Wunused-parm-9.C: New test.

From-SVN: r245802
2017-03-01 09:35:55 +01:00
Jakub Jelinek 0f3f4ffeaf re PR tree-optimization/79734 (ICE: verify_gimple failed)
PR tree-optimization/79734
	* tree-vect-generic.c (expand_vector_condition): Optimize
	AVX512 vector boolean VEC_COND_EXPRs into bitwise operations.
	Handle VEC_COND_EXPR where comparison has different inner width from
	type's inner width.

	* g++.dg/opt/pr79734.C: New test.

From-SVN: r245801
2017-03-01 09:34:48 +01:00
Jakub Jelinek ad1de65225 re PR tree-optimization/79737 (wrong code at -O2 and -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes))
PR tree-optimization/79737
	* gimple-ssa-store-merging.c (encode_tree_to_bitpos): If bitlen is
	a multiple of BITS_PER_UNIT and !BYTES_BIG_ENDIAN, clear
	tmpbuf[byte_size - 1].  Call natice_encode_expr with byte_size - 1
	instead of byte_size.  Formatting fix.
	(shift_bytes_in_array_right): Formatting fix.

	* gcc.c-torture/execute/pr79737-1.c: New test.
	* gcc.c-torture/execute/pr79737-2.c: New test.

From-SVN: r245795
2017-02-28 23:39:11 +01:00