Commit Graph

29904 Commits

Author SHA1 Message Date
Martin Liska a261ee4913 Use HOST_WIDE_INT for a param calculation (PR rtl-optimization/79574).
2017-02-17  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/79574
	* gcc.dg/pr79574.c: New test.
2017-02-17  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/79574
	* gcse.c (want_to_gcse_p): Prevent integer overflow.

From-SVN: r245531
2017-02-17 14:46:14 +00:00
Marek Polacek 5bf69d74ab re PR middle-end/79536 (ICE in fold_binary_loc, at fold-const.c:9060)
PR middle-end/79536
	* fold-const.c (fold_negate_expr_1): Renamed from fold_negate_expr.
	(fold_negate_expr): New wrapper.

	* gcc.dg/torture/pr79536.c: New test.

From-SVN: r245526
2017-02-17 09:51:38 +00:00
Alan Modra a72b242eac re PR rtl-optimization/79286 (ira and lra wrong code at -O2 and -Os on i686-linux)
2017-02-16  Alan Modra  <amodra@gmail.com>

	PR rtl-optimization/79286
	* ira.c (def_dominates_uses): New function.
	(update_equiv_regs): Don't create an equivalence for insns that
	may trap where the register def does not dominate the use.

	* gcc.c-torture/execute/pr79286.c: New.

From-SVN: r245521
2017-02-16 15:56:51 -07:00
Jakub Jelinek bcac0b4dac re PR c++/79512 (ICE: Segfault in gimple_build_call_1, at gimple.c:218)
PR c++/79512
c/
	* c-parser.c (c_parser_omp_target): For -fopenmp-simd
	ignore #pragma omp target even when not followed by identifier.
cp/
	* parser.c (cp_parser_omp_target): For -fopenmp-simd
	ignore #pragma omp target even when not followed by identifier.
testsuite/
	* c-c++-common/gomp/pr79512.c: New test.

From-SVN: r245504
2017-02-16 13:02:24 +01:00
Martin Sebor 945c17d8c1 PR c++/79363 - ICE with NSDMI and array
gcc/cp/ChangeLog:

	PR c++/79363
	* init.c (maybe_reject_flexarray_init): New function.
	(perform_member_init): Call it.

gcc/testsuite/ChangeLog:

	PR c++/79363
	* g++.dg/ext/flexary12.C: Adjust.
	* g++.dg/ext/flexary20.C: Same.
	* g++.dg/ext/flexary21.C: Same.
	* g++.dg/ext/flexary22.C: New test.

From-SVN: r245494
2017-02-15 13:28:32 -07:00
Bin Cheng 25c9985047 re PR tree-optimization/79347 (vect_do_peeling is messing up profile)
PR tree-optimization/79347
	* tree-vect-loop-manip.c (vect_do_peeling): Maintain profile
	counters during peeling.

	gcc/testsuite
	* gcc.dg/vect/pr79347.c: New test.

From-SVN: r245490
2017-02-15 17:16:29 +00:00
Jakub Jelinek e72028574f re PR c++/79301 (With -Werror=pedantic outside C++17 mode, __has_cpp_attribute(fallthrough) is nonzero but [[fallthrough]] fails)
PR c++/79301
	* parser.c (cp_parser_std_attribute): Don't pedwarn about
	[[deprecated]] with -std=c++11 and [[fallthrough]] with
	-std=c++11 and -std=c++14.

	* g++.dg/cpp1y/feat-cxx11-neg.C: Remove (with pedwarn) from
	[[deprecated]] comment.
	* g++.dg/cpp1y/feat-cxx98-neg.C: Likewise.
	* g++.dg/cpp1y/feat-cxx11.C: Likewise.
	* g++.dg/cpp1y/attr-deprecated-neg.C: Don't expect warnings for
	[[deprecated]] in -std=c++11.
	* g++.dg/cpp0x/fallthrough2.C: Don't expect warnings for
	[[fallthrough]] in -std=c++11 and -std=c++14.

From-SVN: r245489
2017-02-15 18:10:40 +01:00
Jakub Jelinek 4f5e5fcba8 re PR c++/79288 (TLS model wrong for static data members since r241137)
PR c++/79288
	* decl.c (grokdeclarator): For static data members, handle thread_p
	only after handling inline.

	* g++.dg/tls/pr79288.C: New test.

From-SVN: r245488
2017-02-15 18:09:18 +01:00
Marek Polacek c7545f1cb3 re PR c/79515 (ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in do_warn_double_promotion, at c-family/c-warn.c:1867)
PR c/79515
	* c-warn.c (do_warn_double_promotion): Don't warn if an invalid
	conversion has occured.

	* gcc.dg/dfp/pr79515.c: New.

From-SVN: r245485
2017-02-15 16:14:19 +00:00
David Edelsohn 1114b39cdf * g++.dg/cpp0x/pr79296.C: Move dg-do compile directive first.
From-SVN: r245484
2017-02-15 10:37:33 -05:00
Thomas Schwinge 93b87d1ddf Restore Graphite fuse-*.c testing
* Makefile.tpl: Remove HOST_ISLVER.
	(HOST_EXPORTS): Remove ISLVER.
	* Makefile.in: Regenerate.
	gcc/
	* Makefile.in (site.exp): Remove "set ISLVER".
	gcc/testsuite/
	* gcc.dg/graphite/graphite.exp: Merge "fuse_files" into
	"opt_files".

From-SVN: r245483
2017-02-15 15:43:42 +01:00
Jakub Jelinek fa8db6eaf2 re PR target/79487 (Invalid _Decimal32 comparison on s390x)
PR target/79487
	* real.c (real_from_integer): Call real_convert even for decimal.

	* gcc.dg/dfp/pr79487.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-8.c (TEST): Revert
	2017-02-13 change.

From-SVN: r245477
2017-02-15 13:19:53 +01:00
Carl Love 8722316bd6 rs6000.c: Add case statement entry to make the xvcvuxdsp built-in argument unsigned.
gcc/ChangeLog:

2017-02-14  Carl Love  <cel@us.ibm.com>

	* config/rs6000/rs6000.c: Add case statement entry to make the
	xvcvuxdsp built-in argument unsigned.
	* config/rs6000/vsx.md: Fix the source and return operand types so they
	match the instruction definitions from the ISA document.  Fix typo
	in the instruction generation for the (define_insn "vsx_xvcvuxdsp"
	statement.

gcc/testsuite/ChangeLog:

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

	* gcc.target/powerpc/vsx-builtin-3.c: Add missing test case for the
	xvcvsxdsp and xvcvuxdsp instructions.

From-SVN: r245460
2017-02-14 23:11:19 +00:00
Segher Boessenkool 2932fe90d5 rs6000: Fix the vec-adde* testcases once more
David found the vec-adde{,c}-int128.c testcases fail on AIX.  Those
tests should only run on targets that have int128.

This also changes the non-int128 testcases to check for the hardware
they require.


gcc/testsuite/
	* gcc.target/powerpc/vec-adde-int128.c: Only run if int128 exists.
	* gcc.target/powerpc/vec-addec-int128.c: Ditto.
	* gcc.target/powerpc/vec-adde.c: Require vsx_hw, don't require a
	64-bit default target.
	* gcc.target/powerpc/vec-addec.c: Require p8vector_hw, don't require
	a 64-bit default target.

From-SVN: r245453
2017-02-14 21:27:54 +01:00
Jakub Jelinek 63d0903380 re PR target/79481 (AVX512PF: unmasked gather prefetch intrinsics missing)
PR target/79481
	* config/i386/avx512pfintrin.h (_mm512_prefetch_i32gather_pd,
	_mm512_prefetch_i32gather_ps, _mm512_prefetch_i64gather_pd,
	_mm512_prefetch_i64gather_ps): New inline functions and macros.

	* gcc.target/i386/sse-14.c (test_2vx): Add void return type.
	(test_3vx): Change return type from int to void. 
	(_mm512_prefetch_i32gather_ps, _mm512_prefetch_i32scatter_ps,
	_mm512_prefetch_i64gather_ps, _mm512_prefetch_i64scatter_ps,
	_mm512_prefetch_i32gather_pd, _mm512_prefetch_i32scatter_pd,
	_mm512_prefetch_i64gather_pd, _mm512_prefetch_i64scatter_pd): New
	tests.
	* gcc.target/i386/sse-22.c (test_2vx): Add void return type.
	(test_3vx): Change return type from int to void.
	(_mm512_prefetch_i32gather_ps, _mm512_prefetch_i32scatter_ps,
	_mm512_prefetch_i64gather_ps, _mm512_prefetch_i64scatter_ps,
	_mm512_prefetch_i32gather_pd, _mm512_prefetch_i32scatter_pd,
	_mm512_prefetch_i64gather_pd, _mm512_prefetch_i64scatter_pd): New
	tests.
	* gcc.target/i386/avx512pf-vgatherpf0dpd-1.c: Add non-masked
	intrinsic.  Change scan-assembler-times number from 1 to 2.
	* gcc.target/i386/avx512pf-vgatherpf0dps-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf0qpd-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf0qps-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf1dpd-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf1dps-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf1qpd-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf1qps-1.c: Likewise.

From-SVN: r245444
2017-02-14 20:39:17 +01:00
Uros Bizjak 8668fae0b7 re PR middle-end/61225 (Several new failures after r210458 on x86_64-*-* with -m32)
PR middle-end/61225
	* gcc.target/i386/pr49095.c: Add -fno-shrink-wrap to dg-options.
	Use dg-additional-options for ia32 target.  Remove XFAIL.

From-SVN: r245442
2017-02-14 18:54:01 +01:00
Uros Bizjak 95d966091d re PR target/79495 (ICE in extract_constrain_insn, at recog.c:2213)
PR target/79495
	* config/i386/i386.md (*movxf_internal): Add (o,rC) alternative.

testsuite/ChangeLog:

2017-02-14  Uros Bizjak  <ubizjak@gmail.com>

	PR target/79495
	* gcc.target/i386/pr79495.c: New test.

From-SVN: r245441
2017-02-14 18:52:37 +01:00
Marek Polacek 6f207d5810 re PR c++/79420 (ICE on invalid C++ code on x86_64-linux-gnu: in tsubst_copy, at cp/pt.c:14573)
PR c++/79420
	PR c++/79463
	* parser.c (cp_parser_postfix_dot_deref_expression): Avoid
	clobbering if the postfix expression isn't an EXPR_P.

	* g++.dg/cpp1y/pr79463.C: New.
	* g++.dg/template/incomplete10.C: New.
	* g++.dg/template/incomplete9.C: New.

From-SVN: r245440
2017-02-14 17:33:21 +00:00
H.J. Lu ee139af532 Properly store 128-bit constant in large model
When converting TI store with CONST_INT to V1TI store with CONST_VECTOR
in large model, an extra instruction may be needed to load CONST_VECTOR
into a register.  Insert the extra instruction to the right place.

gcc/

	PR target/79498
	* config/i386/i386.c (timode_scalar_chain::convert_insn): Insert
	the extra instruction to the right place to store 128-bit constant
	when needed.

gcc/testsuite/

	PR target/79498
	* gcc.target/i386/pr79498.c: New test.

From-SVN: r245438
2017-02-14 08:53:22 -08:00
Martin Sebor bf00c9e080 PR middle-end/79448 - unhelpful -Wformat-truncation=2 warning
gcc/testsuite/ChangeLog:

	PR middle-end/79448
	* gcc.dg/tree-ssa/builtin-snprintf-warn-3.c: New test.
	* gcc.dg/tree-ssa/pr79448-2.c: New test.
	* gcc.dg/tree-ssa/pr79448.c: New test.

gcc/ChangeLog:

	PR middle-end/79448
	* gimple-ssa-sprintf.c (format_directive): Avoid issuing INT_MAX
	  warning for strings of unknown length.

From-SVN: r245437
2017-02-14 09:51:24 -07:00
Jeff Law 6c022f732a re PR tree-optimization/79095 (spurious stringop-overflow warning)
PR tree-optimization/79095
	* tree-vrp.c (extract_range_from_binary_expr_1): For EXACT_DIV_EXPR,
	if the numerator has the range ~[0,0] make the resultant range ~[0,0].
	(extract_range_from_binary_expr): For MINUS_EXPR with no derived range,
	if the operands are known to be not equal, then the resulting range
	is ~[0,0].
	(intersect_ranges): If the new range is ~[0,0] and the old range is
	wide, then prefer ~[0,0].
	* tree-vrp.c (overflow_comparison_p_1): New function.
	(overflow_comparison_p): New function.
	* tree-vrp.c (register_edge_assert_for_2): Register additional asserts
	if NAME is used in an overflow test.
	(vrp_evaluate_conditional_warnv_with_ops): If the ops represent an
	overflow check that can be expressed as an equality test, then adjust
	ops to be that equality test.

	PR tree-optimization/79095
	* g++.dg/pr79095-1.C: New test
	* g++.dg/pr79095-2.C: New test
	* g++.dg/pr79095-3.C: New test
	* g++.dg/pr79095-4.C: New test
	* g++.dg/pr79095-5.C: New test
	* gcc.c-torture/execute/arith-1.c: Update with more cases.
	* gcc.dg/tree-ssa/pr79095-1.c: New test.

From-SVN: r245434
2017-02-14 08:54:09 -07:00
James Greenhalgh b719f884b4 [Patch AArch64] Use 128-bit vectors when autovectorizing 16-bit float types
gcc/

	* config/aarch64/aarch64.c (aarch64_simd_container_mode): Handle
	HFmode.

gcc/testsuite/

	* gcc.target/aarch64/vect_fp16_1.c: New.

From-SVN: r245429
2017-02-14 14:48:33 +00:00
Prathamesh Kulkarni 1be33173de gimple-pretty-print.c (dump_unary_rhs): Adjust dump format for ABS_EXPR for gimple dump.
2017-02-14  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* gimple-pretty-print.c (dump_unary_rhs): Adjust dump format for
	ABS_EXPR for gimple dump.

c/
	* gimpler-parser.c (c_parser_gimple_statement): Handle ABS_EXPR.
	(c_parser_gimple_unary_expression): Likewise.

testsuite/
	* gcc.dg/gimplefe-25.c: New test.

From-SVN: r245422
2017-02-14 09:21:01 +00:00
Jakub Jelinek 73424a0973 re PR tree-optimization/79408 (Missed VRP optimization of integer modulo)
PR tree-optimization/79408
	* tree-vrp.c (simplify_div_or_mod_using_ranges): Handle also the
	case when on TRUNC_MOD_EXPR op0 is INTEGER_CST.
	(simplify_stmt_using_ranges): Call simplify_div_or_mod_using_ranges
	also if rhs1 is INTEGER_CST.

	* gcc.dg/tree-ssa/pr79408-2.c: New test.

From-SVN: r245420
2017-02-14 09:26:26 +01:00
Richard Biener 977472e8c6 re PR tree-optimization/79432 (ICE: verify_ssa failed)
2017-02-14  Richard Biener  <rguenther@suse.de>

	PR middle-end/79432
	* tree-into-ssa.c (insert_phi_nodes): When the function can
	have abnormal edges rewrite SSA names with broken use-def
	dominance out of SSA and register them for PHI insertion.

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

From-SVN: r245417
2017-02-14 07:58:12 +00:00
Martin Sebor ee75687bc6 PR middle-end/79496 - call to snprintf with zero size eliminated with -Wformat-truncation=2
gcc/ChangeLog:

	PR middle-end/79496
	* gimple-ssa-sprintf.c (pass_sprintf_length::handle_gimple_call): Avoid
	clearing info.nowrite flag when snprintf size argument is a range.

gcc/testsuite/ChangeLog:

	PR middle-end/79496
	* gcc.dg/tree-ssa/builtin-snprintf-2.c: New test.

From-SVN: r245415
2017-02-13 21:38:54 -07:00
Jakub Jelinek ecc04faebc re PR sanitizer/79341 (Many Asan tests fail on s390)
PR sanitizer/79341
	* c-c++-common/ubsan/float-cast-overflow-8.c (TEST): Make min and max
	variables volatile.

From-SVN: r245411
2017-02-14 00:09:09 +01:00
Jakub Jelinek b84702c057 re PR c++/79232 (error: invalid rhs for gimple memory store)
PR c++/79232
	* typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
	on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
	in the rightmost operand.

	* g++.dg/cpp1z/eval-order4.C: New test.
	* g++.dg/other/pr79232.C: New test.

From-SVN: r245401
2017-02-13 20:31:14 +01:00
Nathan Sidwell b9a161ff70 PR c++/79296 - ICE mangling localized template instantiation
PR c++/79296 - ICE mangling localized template instantiation
	* decl2.c (determine_visibility): Use template fn context for
	local class instantiations.

	PR c++/79296
	* g++.dg/cpp0x/pr79296.C: New.

From-SVN: r245398
2017-02-13 17:42:31 +00:00
Segher Boessenkool d8505fac6b rs6000: Fix gcc.dg/tree-ssa/ssa-dom-cse-2.c
The testcase should xfail when compiling for a 64-bit target, not when
the default target is 64-bit.


gcc/testsuite/
	* gcc.dg/tree-ssa/ssa-dom-cse-2.c: Do not xfail powerpc64*-*-*.
	Instead, xfail powerpc-*-*-* && lp64.

From-SVN: r245396
2017-02-13 18:22:39 +01:00
Segher Boessenkool efb802cbca rs6000: testsuite: Fix vec-adde[c]-int128.c
These are a runtime testcases so they should test p8vector_hw instead of
powerpc_p8vector_ok, or they will fail with an illegal instruction on
older processors.

Also they run on any PowerPC, not with just those compilers that were
configured to default to 64-bit targets.


gcc/testsuite/
	* gcc.target/powerpc/vec-adde-int128.c: Use p8vector_hw instead of
	powerpc_p8vector_ok.
	* gcc.target/powerpc/vec-addec-int128.c: Ditto.

From-SVN: r245395
2017-02-13 17:51:25 +01:00
Aaron Sawdey 8d6427c6dd re PR target/79449 (ppc builtin expansion of strncmp can cross page (4k) boundary where it should not)
2017-02-13  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

	PR target/79449
	* gcc.dg/strncmp-2.c: New.  Test strncmp and memcmp builtin expansion
	for reading beyond a 4k boundary.

2017-02-13  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

	PR target/79449
	* config/rs6000/rs6000.c (expand_block_compare): Make sure runtime
	boundary crossing check and subsequent code generation agree.

From-SVN: r245392
2017-02-13 10:00:22 -06:00
Jakub Jelinek 9b7716c9a7 re PR rtl-optimization/79388 (wrong code with -O -fno-tree-coalesce-vars)
PR rtl-optimization/79388
	PR rtl-optimization/79450
	* combine.c (distribute_notes): When removing TEM_INSN for which
	corresponding dest has last value recorded, invalidate that last
	value.

	* gcc.c-torture/execute/pr79388.c: New test.
	* gcc.c-torture/execute/pr79450.c: New test.

From-SVN: r245390
2017-02-13 16:39:59 +01:00
Thomas Koenig 4bb91707a8 re PR fortran/65542 (SPREAD intrinsic incorrectly accepted in initialization expressions with -std=f95)
2017-02-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/65542
	* intrinsic.c (gfc_intrinsic_func_interface):  Return an error
	for -std=f95 for disallowed transformational functions in
	initialization expressions.

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

	PR fortran/65542
	* gfortran.dg/spread_init_expr_2.f90:  New test case.

From-SVN: r245376
2017-02-12 16:10:22 +00:00
Jakub Jelinek e22910c200 re PR sanitizer/79341 (Many Asan tests fail on s390)
PR sanitizer/79341
	* g++.dg/asan/deep-stack-uaf-1.C: New test.

From-SVN: r245361
2017-02-11 19:38:11 +01:00
Jan Hubicka acbbac0444 re PR middle-end/56727 (Recursive call goes through the PLT unnecessarily)
PR tree-ssa/56727
	* gcc.dg/tree-ssa/pr56727.c: New testcase.
	* ipa-utils.c (recursive_call_p): Be more careful about interposition.

From-SVN: r245359
2017-02-11 17:56:02 +00:00
Jakub Jelinek e493f96b95 re PR c++/79457 (Segmentation fault in templated decltype evaluation)
PR c++/79457
	* g++.dg/cpp0x/pr79457.C: New test.

From-SVN: r245344
2017-02-10 21:58:31 +01:00
Segher Boessenkool 773acd5428 testsuite, rs6000: fold-vec-mult-longlong.c
On 32-bit we of course do not generate mulld insns.  This patch makes
the testcase only do the scan-assembler on 64-bit targets.


gcc/testsuite/
	* gcc.target/powerpc/fold-vec-mult-longlong.c: Don't do the
	scan-assembler unless lp64.

From-SVN: r245338
2017-02-10 17:59:51 +01:00
Segher Boessenkool b56f814e8a testsuite, rs6000: Don't xfail 32-bit (PR66612)
-m32 works fine, only 64-bit still fails.


gcc/testsuite/
	PR tree-optimization/66612
	* gcc.target/powerpc/20050830-1.c: Don't xfail on 32-bit.

From-SVN: r245337
2017-02-10 17:58:14 +01:00
Segher Boessenkool 5e659d16e0 testsuite, rs6000: Don't xfail Wtrampolines.c on -m32
This test does not fail with -m32, so we shouldn't xfail it there.


gcc/testsuite/
	* gcc.dg/Wtrampolines.c: Do the xfail for only 64-bit powerpc instead
	of all powerpc.

From-SVN: r245336
2017-02-10 17:55:58 +01:00
Marek Polacek 3799a5b853 re PR c++/79184 (-Wint-in-bool-context triggered erroneously in template parameter)
PR c++/79184
	* cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
	if warnings shouldn't be given.

	* g++.dg/warn/Wint-in-bool-context-1.C: New.

From-SVN: r245335
2017-02-10 16:33:45 +00:00
Marek Polacek 6f4f30bf31 re PR c++/79435 (ICE on invalid C++ code (with member access into an incomplete type) on x86_64-linux-gnu: Segmentation fault)
PR c++/79435
	* pt.c (type_dependent_expression_p): Check if the expression type
	is null.

	* g++.dg/cpp1y/pr79435.C: New.

From-SVN: r245334
2017-02-10 16:32:19 +00:00
Christophe Lyon 052ef81d2d [ARM,AArch64] more poly64 intrinsics and tests
2017-02-06  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* config/aarch64/arm_neon.h (vtst_p8): Rewrite without asm.
	(vtst_p16): Likewise.
	(vtstq_p8): Likewise.
	(vtstq_p16): Likewise.
	(vtst_p64): New.
	(vtstq_p64): Likewise.
	* config/arm/arm_neon.h (vgetq_lane_p64): New.
	(vset_lane_p64): New.
	(vsetq_lane_p64): New.

2017-02-06  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* gcc.target/aarch64/advsimd-intrinsics/p64_p128.c
	(vget_lane_expected, vset_lane_expected, vtst_expected_poly64x1):
	New.
	(vmov_n_expected0, vmov_n_expected1, vmov_n_expected2)
	(expected_vld_st2_0, expected_vld_st2_1, expected_vld_st3_0)
	(expected_vld_st3_1, expected_vld_st3_2, expected_vld_st4_0)
	(expected_vld_st4_1, expected_vld_st4_2, expected_vld_st4_3)
	(vtst_expected_poly64x2): Move to aarch64-only section.
	(vget_lane_p64, vgetq_lane_p64, vset_lane_p64, vsetq_lane_p64)
	(vtst_p64, vtstq_p64): New tests.

From-SVN: r245328
2017-02-10 14:18:16 +01:00
Paolo Carlini a7c8ed0c36 re PR c++/71737 (ICE following 2x pack expansion in non-pack with template alias)
/cp
2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71737
	* pt.c (tsubst_decl): Don't try to preserve a typedef that names
	an error_mark_node as type.

/testsuite
2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71737
	* g++.dg/cpp0x/pr71737.C: New.

From-SVN: r245327
2017-02-10 13:14:05 +00:00
Prasad Ghangal 3dcde5efcd gimple-parser.c (c_parser_gimple_binary_expression): Avoid building IL when arguments are error_mark_node.
2017-02-10  Prasad Ghangal  <prasad.ghangal@gmail.com>
	Richard Biener  <rguenther@suse.de>

	* gimple-parser.c (c_parser_gimple_binary_expression): Avoid
	building IL when arguments are error_mark_node.
	(c_parser_gimple_unary_expression): Likewise.
	(c_parser_gimple_if_stmt): Likewise.
	(c_parser_gimple_switch_stmt): Likewise.
	(c_parser_gimple_return_stmt): Likewise.
	(c_parser_parse_ssa_name): When name lookup fails do not build
	an SSA name.  Use undeclared rather than not declared in error
	reporting.

	* gcc.dg/gimplefe-error-1.c: New testcase.
	* gcc.dg/gimplefe-error-2.c: New testcase.
	* gcc.dg/gimplefe-error-3.c: New testcase.

Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r245326
2017-02-10 12:47:05 +00:00
Jakub Jelinek 6139a3b76c re PR tree-optimization/79411 (ICE: SSA corruption (fail_abnormal_edge_coalesce))
PR tree-optimization/79411
	* tree-ssa-reassoc.c (is_reassociable_op): Return false if
	stmt operands are SSA_NAMEs used in abnormal phis.
	(can_reassociate_p): Return false if op is SSA_NAME used in abnormal
	phis.

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

From-SVN: r245324
2017-02-10 09:47:32 +01:00
Jakub Jelinek 9bfc55d096 re PR c++/79143 ([new inheriting constructors] inheriting constructor fails with brace initialization)
PR c++/79143
	* pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
	from pattern to type.

	* g++.dg/cpp1z/pr79143.C: New test.

Co-Authored-By: Jason Merrill <jason@redhat.com>

From-SVN: r245315
2017-02-09 23:12:15 +01:00
Jan Hubicka 0b90c54148 loop-unswitch-2.c: New testcase.
* gcc.dg/loop-unswitch-2.c: New testcase.
	* gcc.dg/loop-unswitch-1.c: New testcase.
	* tree-ssa-loop-unswitch.c (hoist_guard): Update profile.

From-SVN: r245311
2017-02-09 18:13:35 +00:00
Marek Polacek 192b048b5c re PR c/79428 (ICE in c_parser_consume_token, at c/c-parser.c:770)
PR c/79428
	* c-parser.c (c_parser_omp_ordered): Call c_parser_skip_to_pragma_eol
	instead of c_parser_skip_until_found.

	* c-c++-common/cilk-plus/CK/pr79428-4.c: New test.
	* c-c++-common/cilk-plus/CK/pr79428-7.c: New test.
	* c-c++-common/goacc/pr79428-1.c: New test.
	* c-c++-common/gomp/pr79428-2.c: New test.
	* c-c++-common/gomp/pr79428-5.c: New test.
	* c-c++-common/gomp/pr79428-6.c: New test.
	* c-c++-common/pr79428-3.c: New test.

From-SVN: r245309
2017-02-09 17:07:26 +00:00
Andreas Krebbel e9a9033b59 S/390: Fix glob pattern for vector tests.
2017-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/s390.exp: Fix test glob pattern for vector
	testcases.

From-SVN: r245307
2017-02-09 15:31:27 +00:00
Jakub Jelinek 28f6839be1 re PR c/79413 (ICE in make_ssa_name_fn, at tree-ssanames.c:265)
PR c/79413
	* gimplify.h (is_gimple_sizepos): Only test for INTEGER_CST constants,
	not arbitrary TREE_CONSTANT.

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

From-SVN: r245304
2017-02-09 15:26:40 +01:00
Jakub Jelinek f08683a154 re PR c++/79429 (ICE in add_stmt, at cp/semantics.c:385)
PR c++/79429
	* parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
	non-pragma_compound context here.
	(cp_parser_omp_target): Likewise.
	(cp_parser_pragma): Don't call push_omp_privatization_clauses and
	parsing for ordered and target omp pragmas in non-pragma_stmt
	non-pragma_compound contexts.

	* c-c++-common/gomp/pr79429.c: New test.
	* g++.dg/gomp/pr79429.C: New test.

From-SVN: r245303
2017-02-09 15:06:58 +01:00
Jakub Jelinek 56f7147848 re PR c/79431 (ICE in get, at cgraph.h:397)
PR c/79431
	* gimplify.c (gimplify_adjust_omp_clauses): Ignore
	"omp declare target link" attribute unless is_global_var.
	* omp-offload.c (find_link_var_op): Likewise.
c/
	* c-parser.c (c_parser_omp_declare_target): Don't invoke
	symtab_node::get on automatic variables.
cp/
	* parser.c (cp_parser_oacc_declare): Formatting fix.
	(cp_parser_omp_declare_target): Don't invoke symtab_node::get on
	automatic variables.
testsuite/
	* c-c++-common/gomp/pr79431.c: New test.

From-SVN: r245302
2017-02-09 15:01:44 +01:00
Chung-Lin Tang 02889d23ee gimplify.c (gimplify_scan_omp_clauses): No special handling for OMP_CLAUSE_TILE.
2017-02-09  Nathan Sidwell  <nathan@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>
	    Joseph Myers  <joseph@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>

	gcc/
	* gimplify.c (gimplify_scan_omp_clauses): No special handling for
	OMP_CLAUSE_TILE.
	(gimplify_adjust_omp_clauses): Don't delete TILE.
	(gimplify_omp_for): Deal with TILE.
	* internal-fn.c (expand_GOACC_TILE): New function.
	* internal-fn.def (GOACC_DIM_POS): Comment may be overly conservative.
	(GOACC_TILE): New.
	* omp-expand.c (struct oacc_collapse): Add tile and outer fields.
	(expand_oacc_collapse_init): Add LOC paramter.  Initialize tile
	element fields.
	(expand_oacc_collapse_vars): Add INNER parm, adjust for tiling,
	avoid DIV for outermost collapse var.
	(expand_oacc_for): Insert tile element loop as needed.  Adjust.
	Remove out of date comments, fix whitespace.
	* omp-general.c (omp_extract_for_data): Deal with tiling.
	* omp-general.h (enum oacc_loop_flags): Add OLF_TILE flag,
	adjust OLF_DIM_BASE value.
	(struct omp_for_data): Add tiling field.
	* omp-low.c (scan_sharing_clauses): Allow OMP_CLAUSE_TILE.
	(lower_oacc_head_mark): Add OLF_TILE as appropriate.  Ensure 2 levels
	for auto loops.  Remove default auto determining, moved to
	oacc_loop_fixed_partitions.
	* omp-offload.c (struct oacc_loop): Change 'ifns' to vector of call
	stmts, add e_mask field.
	(oacc_dim_call): New function, abstracted out from oacc_thread_numbers.
	(oacc_thread_numbers): Use oacc_dim_call.
	(oacc_xform_tile): New.
	(new_oacc_loop_raw): Initialize e_mask, adjust for ifns vector.
	(finish_oacc_loop): Adjust for ifns vector.
	(oacc_loop_discover_walk): Append loop abstraction sites to list,
	add case for GOACC_TILE fns.
	(oacc_loop_xform_loop): Delete.
	(oacc_loop_process): Iterate over call list directly, and add
	handling for GOACC_TILE fns.
	(oacc_loop_fixed_partitions): Determine default auto, deal with TILE,
	dump partitioning.
	(oacc_loop_auto_partitions): Add outer_assign parm. Assign all but
	vector partitioning to outer loops.  Assign 2 partitions to loops
	when available. Add TILE handling.
	(oacc_loop_partition): Adjust oacc_loop_auto_partitions call.
	(execite_oacc_device_lower): Process GOACC_TILE fns, ignore unknown specs.
	* tree-nested.c (convert_nonlocal_omp_clauses): Allow OMP_CLAUSE_TILE.
	* tree.c (omp_clause_num_ops): Adjust TILE ops.
	* tree.h (OMP_CLAUSE_TILE_ITERVAR, OMP_CLAUSE_TILE_COUNT): New.

	gcc/c/
	* c-parser.c (c_parser_omp_clause_collapse): Disallow tile.
	(c_parser_oacc_clause_tile): Disallow collapse. Fix parsing and
	semantic checking.
	* c-parser.c (c_parser_omp_for_loop): Accept tiling constructs.

	gcc/cp/
	* parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
	parsing.  Parse constant expression. Remove semantic checking.
	(cp_parser_omp_clause_collapse): Disallow tile.
	(cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
	error about missing for after already emitting one.  Use more
	conventional for idiom for unbounded loop.
	* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
	* semantics.c (finish_omp_clauses): Correct TILE semantic check.
	(finish_omp_for): Deal with tile clause.

	gcc/fortran/
	* openmp.c (resolve_omp_clauses): Error on directives
	containing both tile and collapse clauses.
	(resolve_oacc_loop_blocks): Represent '*' tile arguments as zero.
	* trans-openmp.c (gfc_trans_omp_do): Lower tiled loops like
	collapsed loops.

	gcc/testsuite/
	* c-c++-common/goacc/combined-directives.c: Remove xfail.
	* c-c++-common/goacc/loop-auto-1.c: Adjust and add additional case.
	* c-c++-common/goacc/loop-auto-2.c: New.
	* c-c++-common/goacc/tile.c: Include stdbool, fix expected errors.
	* c-c++-common/goacc/tile-2.c: New.
	* g++.dg/goacc/template.C: Test tile subst.  Adjust erroneous uses.
	* g++.dg/goacc/tile-1.C: New, check tile subst.
	* gcc.dg/goacc/loop-processing-1.c: Adjust dg-final pattern.
	* gfortran.dg/goacc/combined-directives.f90: Remove xfail.
	* gfortran.dg/goacc/tile-1.f90: New test.
	* gfortran.dg/goacc/tile-2.f90: New test.
	* gfortran.dg/goacc/tile-lowering.f95: New test.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/tile-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Adjust and
	add additional case.
	* testsuite/libgomp.oacc-c-c++-common/vprop.c: XFAIL under
	"openacc_nvidia_accel_selected".
	* libgomp.oacc-fortran/nested-function-1.f90 (test2):
	Add num_workers(8) clause.

From-SVN: r245300
2017-02-09 13:46:20 +00:00
Richard Biener 9c0c77d279 re PR tree-optimization/69823 (internal compiler error: in create_pw_aff_from_tree, at graphite-sese-to-poly.c:445)
2017-02-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/69823
	* graphite-scop-detection.c (scop_detection::harmful_loop_in_region):
	Properly enumerate all BBs in the region.  Use auto_vec/auto_bitmap.

	* gcc.dg/graphite/pr69823.c: New testcase.

From-SVN: r245295
2017-02-09 07:47:07 +00:00
Pat Haugen f39bad9fd0 re PR target/78604 (test case gcc.target/powerpc/p8vector-vectorize-1.c fails starting with r242750)
PR target/78604
	* config/rs6000/rs6000.c (rs6000_emit_vector_cond_expr): Invert
	condition/operands for integer GE/LE/GEU/LEU operations.

	* gcc.target/powerpc/pr78604.c: New.

From-SVN: r245285
2017-02-08 20:49:14 +00:00
Kelvin Nilsen fc00b9ced7 re PR testsuite/68972 (g++.dg/cpp1y/vla-initlist1.C test case fails on powerpc64le)
gcc/testsuite/ChangeLog:

2017-02-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/68972
	* g++.dg/cpp1y/vla-initlist1.C: Add dg-skip-if directive to
	disable this test on power architecture.

From-SVN: r245280
2017-02-08 17:33:57 +00:00
Richard Biener 50c1f4a5e1 re PR tree-optimization/71824 (ICE when compiling libiberty with Graphite loop optimizations)
2017-02-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71824
	PR tree-optimization/79409
	* gcc.dg/graphite/pr71824-3.c: New testcase.

From-SVN: r245274
2017-02-08 09:35:41 +00:00
Jakub Jelinek 74a15d1424 re PR tree-optimization/79408 (Missed VRP optimization of integer modulo)
PR tree-optimization/79408
	* tree-vrp.c (simplify_div_or_mod_using_ranges): If op1 is not
	constant, but SSA_NAME with a known integer range, use the minimum
	of that range instead of op1 to determine if modulo can be replaced
	with its first operand.

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

From-SVN: r245273
2017-02-08 10:21:57 +01:00
Richard Biener d798497efc re PR tree-optimization/71824 (ICE when compiling libiberty with Graphite loop optimizations)
2017-02-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71824
	* graphite-scop-detection.c (scop_detection::build_scop_breadth):
	Check all loops contained in the merged region.

	* gcc.dg/graphite/pr71824-2.c: New testcase.

From-SVN: r245270
2017-02-08 08:30:48 +00:00
Andrew Pinski 9d5019a196 aarch64.md (popcount<mode>2): New pattern.
2016-02-07  Andrew Pinski  <apinski@cavium.com>

gcc
	* config/aarch64/aarch64.md (popcount<mode>2): New pattern.

gcc/testsuite
	* gcc.target/aarch64/popcount.c : New Testcase.

From-SVN: r245267
2017-02-08 02:54:17 +00:00
Jakub Jelinek ec48209a6c re PR rtl-optimization/79386 (ICE: segmentation fault in cprop w/ -O2 on 32-bit BE powerpc)
PR rtl-optimization/79386
	* cprop.c (bypass_conditional_jumps): Initialize
	bypass_last_basic_block already before splitting bbs after
	unconditional traps...
	(bypass_conditional_jumps): ... rather than here.

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

From-SVN: r245251
2017-02-07 18:45:57 +01:00
Dominik Vogt e5f234b2c4 Only xfail g++.dg/tls/thread_local-order2.C on Solaris
2017-02-07  Dominik Vogt  <vogt@linux.vnet.ibm.com>
	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* g++.dg/tls/thread_local-order2.C: Only xfail execution on
	*-*-solaris*.

Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

From-SVN: r245249
2017-02-07 17:13:40 +00:00
Jakub Jelinek 1f138b7529 re PR target/79299 (Operand size mismatch for `vpgatherqd' w/ -O3 -masm=intel -mavx512bw)
PR target/79299
	* config/i386/sse.md (xtg_mode, gatherq_mode): New mode attrs.
	(*avx512f_gathersi<mode>, *avx512f_gathersi<mode>_2,
	*avx512f_gatherdi<mode>, *avx512f_gatherdi<mode>_2): Use them,
	fix -masm=intel patterns.

	* gcc.target/i386/avx512vl-pr79299-1.c: New test.
	* gcc.target/i386/avx512vl-pr79299-2.c: New test.

From-SVN: r245248
2017-02-07 16:42:42 +01:00
Richard Biener 7af4b20d83 gimple-parser.c (c_parser_gimple_expr_list): Simplify.
2017-02-07  Richard Biener  <rguenther@suse.de>

	c/
	* gimple-parser.c (c_parser_gimple_expr_list): Simplify.
	(c_parser_gimple_postfix_expression_after_primary):
	Do not use c_build_function_call_vec to avoid folding and promotion.
	Simplify.

	* gcc.dg/gimplefe-23.c: New testcase.
	* gcc.dg/gimplefe-24.c: Likewise.

From-SVN: r245244
2017-02-07 11:26:08 +00:00
Christophe Lyon d95c2fc7b3 [AArch64,testsuite] Fix epilogue scan after ifcombine update.
2017-02-07  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.target/aarch64/test_frame_1.c: Scan epilogue with
	scan-assembler instead of scan-assembler-times.
	* gcc.target/aarch64/test_frame_10.c: Likewise.
	* gcc.target/aarch64/test_frame_12.c: Likewise.
	* gcc.target/aarch64/test_frame_2.c: Likewise.
	* gcc.target/aarch64/test_frame_4.c: Likewise.
	* gcc.target/aarch64/test_frame_6.c: Likewise.
	* gcc.target/aarch64/test_frame_7.c: Likewise.
	* gcc.target/aarch64/test_frame_8.c: Likewise.

From-SVN: r245242
2017-02-07 10:32:14 +01:00
Rainer Orth fa5d44d013 Require ifunc support in gcc.target/i386/pr78419.c
* gcc.target/i386/pr78419.c: Require ifunc support.

From-SVN: r245241
2017-02-07 09:13:12 +00:00
David Edelsohn d9b4ce00e4 * gcc.dg/torture/stackalign/builtin-apply-2.c: Fix skip-if syntax.
From-SVN: r245240
2017-02-06 21:26:48 -05:00
Patrick Palka bb7d75ffce re PR c++/79360 (ICE with NSDMI and enum in union)
Fix PR c++/79360

gcc/cp/ChangeLog:

	PR c++/79360
	* typeck2.c (process_init_constructor_union): Consider only
	FIELD_DECLs when looking for an NSDMI.

gcc/testsuite/ChangeLog:

	PR c++/79360
	* g++.dg/cpp1y/nsdmi-union2.C: New test.

From-SVN: r245239
2017-02-07 02:20:48 +00:00
Kito Cheng 122e7b4f9d RISC-V Port: gcc/testsuite
gcc/testsuite/ChangeLog:

2017-02-06  Kito Cheng  <kito.cheng@gmail.com>

        * lib/target-supports.exp: Define the RISC-V target.
        * g++.dg/cpp0x/constexpr-rom.C: Skip on RISC-V
        * gcc.dg/builtin-apply2.c: Likewise.
        * gcc.dg/ifcvt-4.c: Likewise.
        * gcc.dg/loop-8.c: Likewise.
        * gcc.dg/sibcall-10.c: Likewise.
        * gcc.dg/sibcall-9.c: Likewise.
        * gcc.dg/torture/stackalign/builtin-apply-2.c: Likewise.
        * gcc.dg/tree-ssa/20040204-1.c: Likewise.
        * gcc.dg/tree-ssa/ssa-dom-cse-2.c: Likewise.
        * gcc.dg/tree-ssa/ssa-fre-3.c: Likewise.
        * gcc.c-torture/execute/20101011-1.c: Define DO_TEST on RISC-V.
        * gcc.dg/20020312-2.c: Don't define PIC_REG on RISC-V.
        * gcc.dg/stack-usage-1.c: Define SIZE on RISC-V.

From-SVN: r245228
2017-02-06 21:39:03 +00:00
Michael Meissner 391675acd2 re PR target/66144 (vector element operator produces very bad code)
[gcc]
2017-02-06  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/66144
	* config/rs6000/vector.md (vcond<mode><mode>): Allow the true and
	false values to be constant vectors with all 0 or all 1 bits set.
	(vcondu<mode><mode>): Likewise.
	* config/rs6000/predicates.md (vector_int_reg_or_same_bit): New
	predicate.
	(fpmask_comparison_operator): Update comment.
	(vecint_comparison_operator): New predicate.
	* config/rs6000/rs6000.c (rs6000_emit_vector_cond_expr): Optimize
	vector conditionals when the true and false values are constant
	vectors with all 0 bits or all 1 bits set.

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

	PR target/66144
	* gcc.target/powerpc/pr66144-1.c: New test.
	* gcc.target/powerpc/pr66144-2.c: Likewise.
	* gcc.target/powerpc/pr66144-3.c: Likewise.

From-SVN: r245222
2017-02-06 21:07:37 +00:00
Martin Sebor e495e31a20 PR tree-optimization/ 79376 - wrong lower bound with %s and non-constant
strings in -Wformat-overflow

gcc/ChangeLog:
	* gimple-fold.c (get_range_strlen): Set the minimum length to zero.

From-SVN: r245221
2017-02-06 13:11:51 -07:00
Jakub Jelinek 98e0924501 re PR c++/79379 (ICE with #pragma GCC ivdep)
PR c++/79379
	* constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
	(potential_constant_expression_1): Likewise.

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

From-SVN: r245220
2017-02-06 21:06:16 +01:00
Jakub Jelinek e8b0383c13 re PR c++/79377 (ICE with increment operator in -fpermissive mode)
PR c++/79377
	* tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
	allow one fewer than expected arguments if flag_permissive.

	* g++.dg/lookup/pr79377.C: New test.

From-SVN: r245219
2017-02-06 21:05:09 +01:00
Jakub Jelinek a5e8cbd150 re PR c++/79372 (ICE on C++ code with illegal decomposition declaration on x86_64-linux-gnu: in tsubst_decomp_names, at cp/pt.c:15599)
PR c++/79372
	* decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
	* pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
	with error_mark_node type.

	* g++.dg/cpp1z/decomp25.C: New test.

From-SVN: r245218
2017-02-06 21:03:15 +01:00
Jakub Jelinek 2568d8a1f6 re PR tree-optimization/79284 (ICE on valid code at -O3 on x86_64-linux-gnu: verify_gimple failed)
PR tree-optimization/79284
	* tree-vectorizer.h (VECT_SCALAR_BOOLEAN_TYPE_P): Define.
	* tree-vect-stmts.c (vect_get_vec_def_for_operand,
	vectorizable_mask_load_store, vectorizable_operation,
	vect_is_simple_cond, get_same_sized_vectype): Use it instead
	of comparing TREE_CODE of a type against BOOLEAN_TYPE.
	* tree-vect-patterns.c (check_bool_pattern, search_type_for_mask_1,
	vect_recog_bool_pattern, vect_recog_mask_conversion_pattern): Likewise.
	* tree-vect-slp.c (vect_get_constant_vectors): Likewise.
	* tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
	Remove redundant gimple_code (stmt) == GIMPLE_ASSIGN test after
	is_gimple_assign (stmt).  Replace another such test with
	is_gimple_assign (stmt).
testsuite/
	* gcc.c-torture/compile/pr79284.c: New test.

From-SVN: r245214
2017-02-06 20:15:36 +01:00
Paolo Carlini aae936b9a3 re PR c++/70448 (ICE on invalid code on x86_64-linux-gnu: unexpected expression ‘f’ of kind overload)
2017-02-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/70448
	* g++.dg/cpp0x/pr70448.C: New.

From-SVN: r245213
2017-02-06 17:49:31 +00:00
Dominik Vogt daf57541f3 PR 78348: Limit amount of unrolling in test.
gcc/testsuite/ChangeLog:

2017-02-06  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR 78348
	* gcc.dg/tree-ssa/ldist-24.c: Add "--param max-completely-peel-times=8"
	to dg-options.

From-SVN: r245210
2017-02-06 15:14:09 +00:00
Georg-Johann Lay 0898c74df4 re PR rtl-optimization/78883 ([avr] ICE triggered by change to combine.c (r243578))
gcc/
	PR target/78883
	* config/avr/avr.c (rtl-iter.h): Include it.
	(TARGET_LEGITIMATE_COMBINED_INSN): New hook define...
	(avr_legitimate_combined_insn): ...and implementation.
gcc/testsuite/
	PR target/78883
	* gcc.c-torture/compile/pr78883.c: New test.

From-SVN: r245209
2017-02-06 13:38:56 +00:00
Jan Hubicka 5d3ebb71cb re PR tree-optimization/79347 (vect_do_peeling is messing up profile)
PR tree-ssa/79347
	* cfgloopmanip.c (lv_adjust_loop_entry_edge, loop_version): Add
	ELSE_PROB.
	* cfgloopmanip.h (loop_version): Update prototype.
	* modulo-sched.c (sms_schedule): Update call of loop_version.
	* tree-if-conv.c(version_loop_for_if_conversion): Likewise.
	* tree-parloops.c (gen_parallel_loop): Likewise.
	* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Likewise.
	* tree-ssa-loop-split.c (split_loop): Likewise.
	* tree-ssa-loop-unswitch.c (tree_unswitch_loop): Likewise.
	* tree-vect-loop-manip.c (vect_loop_versioning): Likewise.

	* gcc.dg/tree-ssa/ifc-10.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-11.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-12.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-20040816-1.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-20040816-2.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-5.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-8.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-9.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-cd.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-pr56541.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-pr68583.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-pr69489-1.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-pr69489-2.c: Match for profile mismatches.

From-SVN: r245196
2017-02-05 17:16:52 +00:00
Andre Vehreschild 139d4065e8 re PR fortran/79344 (segmentation faults and run-time errors)
gcc/fortran/ChangeLog:

2017-02-05  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/79344
	* trans-stmt.c (gfc_trans_allocate): Only deallocate the components of
	the temporary, when a new object was created for the temporary.  Not
	when it is just an alias to an existing object.

gcc/testsuite/ChangeLog:

2017-02-04  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/79344
	* gfortran.dg/allocate_with_source_24.f90: New test.

From-SVN: r245194
2017-02-05 16:43:03 +01:00
Andre Vehreschild 4b9c80d8e4 re PR fortran/79230 ([OOP] Run time error: double free or corruption)
gcc/fortran/ChangeLog:

2017-02-05  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/79230
	* trans-array.c (structure_alloc_comps): Ignore pointer components when
	freeing structures.

gcc/testsuite/ChangeLog:

2017-02-05  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/79230
	* gfortran.dg/der_ptr_component_2.f90: New test.

From-SVN: r245191
2017-02-05 13:02:15 +01:00
Eric Botcazou f3877b2f70 re PR target/79353 (ICE in curr_insn_transform, at lra-constraints.c:3773)
PR target/79353
	* config/sparc/sync.md (atomic_loaddi_1): Replace 'U' constraint with
	'r', 'm' constraint with 'T' and !TARGET_ARCH64 with TARGET_ARCH32.
	(atomic_storedi_1): Likewise.

From-SVN: r245188
2017-02-05 09:47:48 +00:00
John David Anglin a2a86d6a7c coarray_43.f90: Add "-latomic" option if libatomic_available.
* gfortran.dg/coarray_43.f90: Add "-latomic" option if
	libatomic_available.

From-SVN: r245182
2017-02-04 01:37:12 +00:00
John David Anglin a1d9992507 pr77587.c: Require alias support.
* gcc.dg/pr77587.c: Require alias support.
	* gcc.dg/pr77587a.c: Likewise.

From-SVN: r245181
2017-02-04 01:28:56 +00:00
John David Anglin d8bf159ef2 pr78112-2.C: Skip on hppa*-*-hpux*.
* g++.dg/pr78112-2.C: Skip on hppa*-*-hpux*.
	* gcc.c-torture/execute/pr78622.c: Likewise.

From-SVN: r245180
2017-02-04 01:16:54 +00:00
John David Anglin d8a09adacf Wunused-var-15.c: Add -fno-common additional option on hppa*-*-hpux*.
* c-c++-common/Wunused-var-15.c: Add -fno-common additional option on
	hppa*-*-hpux*.
	* c-c++-common/Wunused-var-16.c: Likewise.
	* c-c++-common/builtin-shuffle-1.c: Likewise.
	* gcc.dg/debug/dwarf2/align-[1-6].c Likewise.
	* gcc.dg/debug/dwarf2/align-as-1.c: Likewise.

From-SVN: r245179
2017-02-04 00:54:06 +00:00
Martin Sebor f589a1ce25 PR tree-optimization/79327 - wrong code at -O2 and -fprintf-return-value
PR tree-optimization/79327 - wrong code at -O2 and -fprintf-return-value
gcc/ChangeLog:
	* gimple-ssa-sprintf.c (tree_digits): Avoid adding the base prefix
	when precision has resulted in leading zeros.
	(format_integer): Adjust the likely counter to assume an unknown
	argument that may be zero is non-zero.

gcc/testsuite/ChangeLog:
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Adjust.
	* gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-13.c: New test.
	* gcc/testsuite/gcc.dg/tree-ssa/pr79327-2.c: Ditto.

From-SVN: r245173
2017-02-03 15:47:35 -07:00
Jakub Jelinek 5b00f9d236 re PR tree-optimization/79327 (wrong code at -O2 and -fprintf-return-value)
PR tree-optimization/79327
	* gimple-ssa-sprintf.c (adjust_range_for_overflow): If returning
	true, always set *argmin and *argmax to TYPE_{MIN,MAX}_VALUE of
	dirtype.
	(format_integer): Use wide_int_to_tree instead of build_int_cst
	+ to_?hwi.  If argmin is NULL, just set argmin and argmax to
	TYPE_{MIN,MAX}_VALUE of argtype.  Simplify and fix computation
	of shortest and longest sequence.

	* gcc.dg/tree-ssa/pr79327.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
	(test_sprintf_chk_hh_nonconst): Don't expect 2 bogus warnings.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
	(test_sprintf_chk_range_schar): Adjust dg-message.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-12.c: New test.
	* gcc.c-torture/execute/pr79327.c: New test.

Co-Authored-By: Martin Sebor <msebor@redhat.com>

From-SVN: r245166
2017-02-03 20:16:39 +01:00
Jakub Jelinek 437f0a81bd re PR target/79354 (-mcpu=power8 -O2 generates power9 instruction on powerpc64le-linux)
PR target/79354
	* config/rs6000/rs6000.md (movsi_from_sf): Use wb constraint instead of
	wu for stxssp alternative.

	* gcc.target/powerpc/pr79354.c: New test.
	* gcc.c-torture/execute/pr79354.c: New test.

From-SVN: r245157
2017-02-03 18:34:56 +01:00
Martin Sebor 3f3430400b PR tree-optimization/79352 - -fprintf-return-value doesn't handle flexible-like array members properly
gcc/ChangeLog:

	PR tree-optimization/79352
	* gimple-fold.c (get_range_strlen): Add argument.
	(get_range_strlen): Change return type to bool.
	(get_maxval_strlen): Pass in a dummy argument.
	* gimple-fold.h (get_range_strlen): Change return type to bool.
	* gimple-ssa-sprintf.c (get_string_length): Set unlikely counter.
	* tree.h (array_at_struct_end_p): Add argument.
	* tree.c (array_at_struct_end_p): Handle it.

gcc/testsuite/ChangeLog:

	PR tree-optimization/79352
	* gcc.dg/tree-ssa/pr79352.c: New test.

From-SVN: r245156
2017-02-03 09:38:15 -07:00
Martin Liska 46a2ab580a Simplify creation of target_clones (PR lto/66295)
2017-02-03  Martin Liska  <mliska@suse.cz>

	PR lto/66295
	* multiple_target.c (create_dispatcher_calls): Redirect edge
	from a caller of a dispatcher.
	(expand_target_clones): Make the clones local.
	(ipa_target_clone): Do both target clones and resolvers.
	(ipa_dispatcher_calls): Remove the pass.
	(pass_dispatcher_calls::gate): Likewise.
	(make_pass_dispatcher_calls): Likewise.
	* passes.def (pass_target_clone): Put as very first IPA early
	pass.
2017-02-03  Martin Liska  <mliska@suse.cz>

	PR lto/66295
	* gcc.target/i386/mvc9.c: New test.

From-SVN: r245155
2017-02-03 15:22:47 +00:00
Pat Haugen baa2d1cd76 re PR rtl-optimization/78241 (wrong code with -funroll-loops)
PR rtl-optimization/78241
	* loop-unroll.c (unroll_loop_runtime_iterations): Don't adjust 'niter', but
	emit initial peel copy if niter expr is not reliable.

From-SVN: r245152
2017-02-03 14:20:30 +00:00
Jan Hubicka 30c6ec2f53 tree-ssa-ifcombine.c (update_profile_after_ifcombine): New function.
* tree-ssa-ifcombine.c (update_profile_after_ifcombine): New function.
	(ifcombine_ifandif): Use it.
	* gcc.dg/tree-ssa/ssa-ifcombine-1.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-2.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-3.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-4.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-5.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-6.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-7.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-8.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-9.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-10.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-11.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-12.c: Check for no profile mismatches.
	* gcc.dg/tree-ssa/ssa-ifcombine-13.c: Check for no profile mismatches.

From-SVN: r245151
2017-02-03 14:03:35 +00:00
Martin Sebor ebee1eb978 PR middle-end/79275 - -Wformat-overflow false positive exceeding INT_MAX in glibc sysdeps/posix/tempname.c
gcc/testsuite/ChangeLog:

	PR middle-end/79275
	* gcc.dg/tree-ssa/builtin-sprintf-warn-11.c: New test.
	* gcc.dg/tree-ssa/pr79275.c: New test.

gcc/ChangeLog:

	PR middle-end/79275
	* gimple-ssa-sprintf.c (get_string_length): Set lower bound to zero.
	(format_string): Tighten up the range of output for non-constant
	strings and correct the expected range for wide non-constant strings.

From-SVN: r245142
2017-02-02 19:18:59 -07:00
Aaron Sawdey dcd25b8a01 sms-8.c: Update options for powerpc*-*-*.
2017-02-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

        * gcc.dg/sms-8.c: Update options for powerpc*-*-*.

From-SVN: r245138
2017-02-02 17:50:53 -06:00
Jan Hubicka 0f0c2cc3a1 re PR tree-optimization/77445 (Performance drop after r239219 on coremark test)
PR middle-end/77445
	* gcc.dg/tree-ssa/pr77445-2.c: Update testcase to check that all
	threading is done.
	* tree-ssa-threadbackward.c (profitable_jump_thread_path): Dump
	statistics of the analyzed path; allow threading for speed when
	any of BBs along the path are optimized for speed.

From-SVN: r245135
2017-02-02 20:22:13 +00:00
Tamar Christina 1c37284010 re PR middle-end/78142 (Commit r241590 is more registers to be used for on gcc.target/aarch64/vector_initialization_nostack.c)
PR middle-end/78142
	* gcc.target/aarch64/vector_initialization_nostack.c
	(f12): Use one vector

From-SVN: r245132
2017-02-02 16:35:15 +00:00
Jakub Jelinek bef7e56112 pr63316.c: Use dg-skip-if instead of dg-options.
* c-c++-common/asan/pr63316.c: Use dg-skip-if instead of dg-options.
	* c-c++-common/asan/misalign-1.c: Likewise.
	* c-c++-common/asan/misalign-2.c: Likewise.
	* g++.dg/asan/pr69276.C: Add dg-skip-if, remove dg-additional-options.
	* gcc.dg/asan/pr66314.c: Remove -Os from dg-options, add dg-skip-if.
	* gcc.dg/asan/use-after-scope-3.c: Use dg-skip-if instead of dg-options.
	* gcc.dg/asan/use-after-scope-9.c: Add dg-skip-if, remove -O2 and
	add -ffat-lto-objects from/to dg-additional-options.
	* gcc.dg/asan/use-after-scope-10.c: Add dg-skip-if, remove -O2 from
	dg-additional-options.

From-SVN: r245121
2017-02-02 11:18:49 +01:00
Jakub Jelinek 9f11a4a76f re PR target/79197 (ICE in extract_insn in gcc/recog.c:2311)
PR target/79197
	* config/rs6000/rs6000.md (*fixuns_trunc<mode>di2_fctiduz): Rename to ...
	(fixuns_trunc<mode>di2): ... this, remove previous expander.  Put all
	conditions on a single line.

	* gcc.target/powerpc/pr79197.c: New test.
	* gcc.c-torture/compile/pr79197.c: New test.

From-SVN: r245120
2017-02-02 11:05:26 +01:00
Richard Biener 0966167499 pr71078-3.c: Do not rely on math.h.
2017-02-02  Richard Biener  <rguenther@suse.de>

	* gcc.dg/tree-ssa/pr71078-3.c: Do not rely on math.h.

From-SVN: r245119
2017-02-02 08:58:48 +00:00
Paolo Carlini d8d58893e4 re PR c++/69637 (ICE on an invalid bit-field with template name for width)
/cp
2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/69637
	* decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
	to the width.

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

	PR c++/69637
	* g++.dg/cpp0x/pr69637-1.C: New.
	* g++.dg/cpp0x/pr69637-2.C: Likewise.

From-SVN: r245117
2017-02-02 08:54:55 +00:00
Andreas Krebbel 521a70a405 S/390: Rename __S390_VX__ to __VX__.
gcc/ChangeLog:

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

	* config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Rename
	__S390_VX__ to __VX__.

gcc/testsuite/ChangeLog:

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

	* gcc.target/s390/s390.exp: Rename __S390_VX__ to __VX__.

From-SVN: r245116
2017-02-02 08:32:44 +00:00
Bill Schmidt e26b502d9b re PR target/70012 (test case gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c fails)
2017-02-01  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/70012
	* gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c: Adjust test
	conditions.

From-SVN: r245108
2017-02-01 22:11:57 +00:00
Jakub Jelinek 55e75c7c6b re PR testsuite/79324 (The tests introduced at revision r245052 fail on darwin)
PR testsuite/79324
	* gcc.dg/debug/dwarf2/align-1.c: Add -gno-strict-dwarf to dg-options.
	* gcc.dg/debug/dwarf2/align-2.c: Likewise.
	* gcc.dg/debug/dwarf2/align-3.c: Likewise.
	* gcc.dg/debug/dwarf2/align-4.c: Likewise.
	* gcc.dg/debug/dwarf2/align-5.c: Likewise.
	* gcc.dg/debug/dwarf2/align-6.c: Likewise.
	* gcc.dg/debug/dwarf2/align-as-1.c: Likewise.
	* g++.dg/debug/dwarf2/align-1.C: Likewise.
	* g++.dg/debug/dwarf2/align-2.C: Likewise.
	* g++.dg/debug/dwarf2/align-3.C: Likewise.
	* g++.dg/debug/dwarf2/align-4.C: Likewise.
	* g++.dg/debug/dwarf2/align-5.C: Likewise.
	* g++.dg/debug/dwarf2/align-6.C: Likewise.

From-SVN: r245097
2017-02-01 16:47:52 +01:00
Martin Liska a44769735d Add dg-require-alias to a ICF test (PR testsuite/79272).
2017-02-01  Martin Liska  <mliska@suse.cz>

	PR testsuite/79272
	* gcc.dg/ipa/pr77653.c: Add dg-require-alias to the test.

From-SVN: r245095
2017-02-01 14:04:38 +00:00
Richard Biener 3f3181b1c2 re PR tree-optimization/76957 (XFAIL: gcc.dg/graphite/scop-dsyr2k.c scan-tree-dump-times graphite "number of SCoPs)
2017-02-01  Richard Biener  <rguenther@suse.de>

	PR testsuite/76957
	* gcc.dg/graphite/scop-dsyr2k-2.c: New testcase.
	* gcc.dg/graphite/scop-dsyrk-2.c: Likewise.
	* gcc.dg/graphite/scop-dsyr2k.c: XFAIL.
	* gcc.dg/graphite/scop-dsyrk.c: Likewise.

From-SVN: r245094
2017-02-01 12:58:27 +00:00
Richard Biener 1e7ef862ac re PR tree-optimization/79315 (ICE while building SPEC CPU 2006 FP with -Ofast -ftree-parallelize-loops)
2017-02-01  Richard Biener  <rguenther@suse.de>

	PR middle-end/79315
	* tree-cfg.c (move_stmt_op): Never set TREE_BLOCK when it
	was not set before.

	* gfortran.dg/pr79315.f90: New testcase.

From-SVN: r245089
2017-02-01 12:47:25 +00:00
Richard Biener 405a740640 re PR tree-optimization/71824 (ICE when compiling libiberty with Graphite loop optimizations)
2017-02-01  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71824
	* graphite-scop-detection.c (scop_detection::build_scop_breadth):
	Verify the loops are valid in the merged SESE region.
	(scop_detection::can_represent_loop_1): Check analyzing the
	evolution of the number of iterations in the region succeeds.

	* gcc.dg/graphite/pr71824.c: New testcase.

From-SVN: r245081
2017-02-01 08:02:50 +00:00
Jakub Jelinek 19bdccb4be re PR c++/79304 (diagnostic shows bogus expression ((X<T>*)this)->.c)
PR c++/79304
	* error.c (dump_expr) <case COMPONENT_REF>: Don't print .
	after ARROW_EXPR.

	* g++.dg/diagnostic/pr79304.C: New test.

From-SVN: r245073
2017-01-31 22:38:00 +01:00
David Malcolm fcb2cdfcfe Fix ICE with spelling hints within explicit namespace aliases (PR c++/79298)
gcc/cp/ChangeLog:
	PR c++/79298
	* name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
	any namespace aliases.

gcc/testsuite/ChangeLog:
	PR c++/79298
	* g++.dg/spellcheck-pr79298.C: New test case.

From-SVN: r245072
2017-01-31 21:30:42 +00:00
David Malcolm 7cfa044d99 Prevent ICEs due to bogus substring locations (PR preprocessor/79210)
gcc/ChangeLog:
	PR preprocessor/79210
	* input.c (get_substring_ranges_for_loc): Replace line_width
	assertion with error-handling.

gcc/testsuite/ChangeLog:
	PR preprocessor/79210
	* gcc.dg/format/pr79210.c: New test case.
	* gcc.dg/plugin/diagnostic-test-string-literals-2.c (test_pr79210):
	New function.

From-SVN: r245070
2017-01-31 20:22:43 +00:00
Nathan Sidwell 5ae37bdfce re PR c++/79290 (forming pointer to member function tries to access "__pfn")
PR c++/79290
	* typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.

	PR c++/79290
	* g++.dg/warn/pr79290.C: New.

From-SVN: r245069
2017-01-31 19:37:11 +00:00
Nathan Sidwell de3fbef690 re PR c++/67273 (Incorrect -Wshadow warning with generic lambdas)
PR c++/67273
	PR c++/79253
	* pt.c: (instantiate_decl): Push to top level when current
	function scope doesn't match.  Only push lmabda scope stack when
	pushing to top.

	PR c++/67273
	PR c++/79253
	* g++.dg/cpp1y/pr67273.C: New.
	* g++.dg/cpp1y/pr79253.C: New.

From-SVN: r245067
2017-01-31 18:05:37 +00:00
Nathan Sidwell 7f357c6164 re PR c++/79264 (ICE verify_type failed)
PR c++/79264
	* lambda.c (maybe_generic_this_capture): Deal with
	template-id-exprs.
	* semantics.c (finish_member_declaration): Assert class is being
	defined.

	PR c++/79264
	* g++.dg/cpp1y/pr61636-1.C: Augment.

From-SVN: r245065
2017-01-31 15:10:41 +00:00
Christophe Lyon 5b11971a56 [testsuite] gcc.dg/memcmp-1.c: Fix testcase for newlib.
2017-01-31  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.dg/memcmp-1.c (static void test_driver_memcmp): Call
	rand() instead of random().

From-SVN: r245061
2017-01-31 15:03:56 +01:00
Aldy Hernandez 8b670f93ab re PR tree-optimization/71691 (wrong code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (Floating point exception))
PR tree-optimization/71691
	* bitmap.h (class auto_bitmap): New.
	* tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Call
	is_maybe_undefined instead of ssa_undefined_value_p.

From-SVN: r245057
2017-01-31 10:30:47 +00:00
Andreas Krebbel 4727e06bb7 S/390: Rename __S390_ARCH_LEVEL__ to __ARCH__.
We have recently added the predefined macro __S390_ARCH_LEVEL__ to
expand to a numerical value representing the architecture document
level currently in use.  However, the IBM XL compiler already has a
macro named __ARCH__ for that purpose.  So we change our macro to that
in order to improve portability.

gcc/ChangeLog:

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

	* config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Rename
	__S390_ARCH_LEVEL__ to __ARCH__.

gcc/testsuite/ChangeLog:

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

	* gcc.target/s390/s390.exp: Rename __S390_ARCH_LEVEL__ to
	__ARCH__.

From-SVN: r245055
2017-01-31 09:14:36 +00:00
Jakub Jelinek b6dae84928 re PR c++/79267 (internal compiler error with -O3 or -O2 -finline-functions)
PR tree-optimization/79267
	* value-prof.c (gimple_ic): Only drop lhs for noreturn calls
	if should_remove_lhs_p is true.

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

From-SVN: r245053
2017-01-31 09:33:36 +01:00
Alexandre Oliva 40fb9c89e1 [PR63238] output alignment debug information
Output DWARFv5+ DW_AT_alignment for non-default alignment of
variables, fields and types.

for gcc/ChangeLog

	PR debug/63238
	* dwarf2out.c (clone_as_declaration): Drop DW_AT_alignment.
	(add_alignment_attribute): New.
	(base_type_die): Add alignment attribute.
	(subrange_type_die): Likewise.
	(modified_type_die): Likewise.
	(gen_array_type_die): Likewise.
	(gen_descr_array_type_die: Likewise.
	(gen_enumeration_type_die): Likewise.
	(gen_subprogram_die): Likewise.
	(gen_variable_die): Likewise.
	(gen_field_die): Likewise.
	(gen_ptr_to_mbr_type_die): Likewise.
	(gen_struct_or_union_type_die): Likewise.
	(gen_subroutine_type_die): Likewise.
	(gen_typedef_die): Likewise.
	(base_type_cmp): Compare alignment attribute.

for gcc/testsuite/ChangeLog

	PR debug/63238
	* gcc.dg/debug/dwarf2/align-1.c: New.
	* gcc.dg/debug/dwarf2/align-2.c: New.
	* gcc.dg/debug/dwarf2/align-3.c: New.
	* gcc.dg/debug/dwarf2/align-4.c: New.
	* gcc.dg/debug/dwarf2/align-5.c: New.
	* gcc.dg/debug/dwarf2/align-6.c: New.
	* gcc.dg/debug/dwarf2/align-as-1.c: New.
	* g++.dg/debug/dwarf2/align-1.C: New.
	* g++.dg/debug/dwarf2/align-2.C: New.
	* g++.dg/debug/dwarf2/align-3.C: New.
	* g++.dg/debug/dwarf2/align-4.C: New.
	* g++.dg/debug/dwarf2/align-5.C: New.
	* g++.dg/debug/dwarf2/align-6.C: New.

From-SVN: r245052
2017-01-31 01:03:15 +00:00
Aaron Sawdey 3095f65123 re PR target/79170 (memcmp builtin expansion sequence can overflow)
2017-01-27  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

	PR target/79170
	* gcc.dg/memcmp-1.c: Improved to catch failures seen in PR 79170.

2017-01-27  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

	PR target/79170
	* config/rs6000/altivec.md (*setb_internal): Rename to setb_signed.
	(setb_unsigned) New pattern for setb with CCUNS.
	* config/rs6000/rs6000.c (expand_block_compare): Use a different
	subfc./subfe sequence to avoid overflow problems.  Generate a
	shorter sequence with cmpld/setb for power9.
	* config/rs6000/rs6000.md (subf<mode>3_carry_dot2): Add a new pattern
	for generating subfc. instruction.
	(cmpstrsi): Add TARGET_POPCNTD predicate as the generate sequence
	now uses this instruction.

From-SVN: r245041
2017-01-30 17:24:24 -06:00
Martin Sebor 3cf88bffdb PR testsuite/79293 - gcc.dg/tree-ssa/builtin-sprintf.c fails starting with r244953
gcc/testsuite/ChangeLog:
	* gcc.dg/tree-ssa/builtin-sprintf.c: Relax long double test.

From-SVN: r245037
2017-01-30 14:59:37 -07:00
Martin Liska 37731134c7 Fix profile corruption with -O1 (PR gcov-profile/79259)
2017-01-30  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/79259
	* opts.c (common_handle_option): Enable flag_ipa_bit_cp w/
	-fprofile-generate.
2017-01-30  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/79259
	* g++.dg/tree-prof/pr79259.C: New test.

From-SVN: r245031
2017-01-30 15:35:57 +00:00
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
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
John David Anglin fc34d7b8c8 trampoline4.adb: Skip on hppa*-*-*.
* gnat.dg/trampoline4.adb: Skip on hppa*-*-*.

From-SVN: r245010
2017-01-28 21:35:54 +00:00
John David Anglin 9efc84e45e re PR testsuite/70583 (FAIL: g++.old-deja/g++.abi/vtable2.C -std=gnu++98 execution test)
PR testsuite/70583
	* g++.old-deja/g++.abi/vtable2.C: Adjust CMP_VPTR define on hppa.

From-SVN: r245007
2017-01-28 18:01:22 +00:00
John David Anglin 4bfbe3ae51 debug7.adb: Skip on hppa*-*-hpux*.
* gnat.dg/debug7.adb: Skip on hppa*-*-hpux*.
	* gnat.dg/debug9.adb: Likewise.

From-SVN: r245006
2017-01-28 17:30:50 +00:00
John David Anglin 8d0b306f50 pr78515.c: Add -fno-common option on hppa*-*-hpux*.
* gcc.dg/torture/pr78515.c: Add -fno-common option on hppa*-*-hpux*.

From-SVN: r245005
2017-01-28 17:19:09 +00:00
John David Anglin b5df96c344 coarray_41.f90: Add "-latomic" option if libatomic_available.
* gfortran.dg/coarray_41.f90: Add "-latomic" option if
	libatomic_available.
	* gfortran.dg/coarray_42.f90: Likewise.
	* gfortran.dg/coarray_alloc_comp_3.f08: Likewise.
	* gfortran.dg/coarray_alloc_comp_4.f08: Likewise.
	* gfortran.dg/coarray_lib_alloc_4.f90: Likewise.

From-SVN: r245004
2017-01-28 17:00:33 +00:00
Martin Sebor eb33936649 builtin-sprintf-warn-1.c: Add test cases.
gcc/testsuite/ChangeLog:
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Add test cases.

From-SVN: r244999
2017-01-27 17:09:15 -07: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
Martin Sebor 9e2ea13ec2 re PR c++/71290 (Flexible array member is not diagnosed with -pedantic)
PR c++/71290

gcc/testsuite/ChangeLog:
	* obj-c++.dg/property/at-property-23.mm: Remove an escaped newline from
	a dg-error directive.

From-SVN: r244990
2017-01-27 09:51:54 -07: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
Bill Schmidt f75bbf3fc6 re PR testsuite/65484 (FAIL: g++.dg/vect/pr36648.cc on powerpc64)
2017-01-27  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/65484
	* g++.dg/vect/pr36648.cc: Modify to reflect that the loop is not
	vectorized on POWER unless hardware misaligned loads are
	available.

From-SVN: r244985
2017-01-27 15:59:02 +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
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
Jakub Jelinek b2f8892e35 re PR c/79199 (ICE with -Wduplicated-branches)
PR c/79199
	* c-c++-common/Wduplicated-branches-13.c: Require int32plus effective
	target.  Use 4294967293U instead of 4294967293.

From-SVN: r244975
2017-01-27 14:25:28 +01: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 c04f41398e fib-opr-overload.cc (main): Change all occurrences of 40 to 32.
* g++.dg/cilk-plus/CK/fib-opr-overload.cc (main): Change
	all occurrences of 40 to 32.

From-SVN: r244967
2017-01-27 12:34:58 +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
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
Adam Butcher bb6a6ee9db re PR c++/64382 (ICE due to use of `this` inside a lambda that captures everything by ref inside a member function of a class template)
Fix PR c++/64382

	PR c++/64382
	* cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
	New function.
	* cp/cp-tree.h: Declare it.
	* cp/semantics.c (finish_id_expression): Resolve names within a default
	capturing generic lambda defined within a template prior to
	instantiation to allow for captures to be added to the closure type.

	PR c++/64382
	* g++.dg/cpp1y/pr64382.C: New test.

From-SVN: r244962
2017-01-27 07:59:06 +00: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
Jakub Jelinek 905d2812e7 re PR c++/68727 (invalid offsetof expressions accepted)
PR c++/68727
	* cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
	* cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
	* parser.c (cp_parser_builtin_offsetof): Pass result of
	build_static_cast of null_pointer_node to finish_offsetof.
	* semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
	it for -Winvalid-offsetof pedwarn instead of trying to guess
	original offsetof type from EXPR.  Save OBJECT_PTR as a new
	second operand to OFFSETOF_EXPR.
	* pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
	finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
	as OBJECT_PTR.

	* g++.dg/other/offsetof8.C: Add expected error.
	* g++.dg/other/offsetof9.C: New test.

From-SVN: r244949
2017-01-26 20:39:40 +01:00
David Edelsohn b3db8d779a * g++.dg/opt/declone3.C: Require LTO.
From-SVN: r244944
2017-01-26 13:19:39 -05: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
Bin Cheng e39dd8029d ldp_vec_64_1.c: Xfail.
gcc/testsuite
	* gcc.target/aarch64/ldp_vec_64_1.c: Xfail.

From-SVN: r244934
2017-01-26 15:04:27 +00:00
Jonathan Wakely bc9efeab61 PR libstdc++/79190 add fallback aligned_alloc implementation
libstdc++-v3:

	PR libstdc++/79190
	* libsupc++/del_opa.cc (operator delete(void*, std::align_val_t))
	[!_GLIBCXX_HAVE_ALIGNED_ALLOC && !_GLIBCXX_HAVE_POSIX_MEMALIGN
	&& !_GLIBCXX_HAVE_MEMALIGN && !_GLIBCXX_HAVE__ALIGNED_MALLOC]:
	Retrieve original pointer value allocated by malloc.
	* libsupc++/new_opa.cc [!_GLIBCXX_HAVE_ALIGNED_ALLOC
	&& !_GLIBCXX_HAVE_POSIX_MEMALIGN && !_GLIBCXX_HAVE_MEMALIGN
	&& !_GLIBCXX_HAVE__ALIGNED_MALLOC] (aligned_alloc(size_t, size_t)):
	Define, adjusting pointer value allocated by malloc and storing for
	retrieval by operator delete.

gcc/testsuite:

	PR libstdc++/79190
	* g++.dg/cpp1z/aligned-new3.C: Replace operator new so behaviour
	matches replaced operator delete.

From-SVN: r244933
2017-01-26 14:30:45 +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
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
Bill Schmidt 3b5de3cb71 vsx-elemrev-4.c: Change expected code generation to accept D-mode memory accesses.
2017-01-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/vsx-elemrev-4.c: Change expected code
	generation to accept D-mode memory accesses.

From-SVN: r244916
2017-01-26 03:21:49 +00:00
Martin Sebor dbe81dbe24 ChangeLog only update missed in r244910.
From-SVN: r244911
2017-01-25 16:19:01 -07:00
Jakub Jelinek a25608aa6f re PR c++/78896 ([C++17] Segmentation fault occurs when use variable initialized using structured binding with capture-by-ref lambda)
PR c++/78896
	* decl.c (cp_finish_decomp): Disallow memberwise decomposition of
	lambda expressions.

	* g++.dg/cpp1z/decomp24.C: New test.

From-SVN: r244909
2017-01-25 23:36:18 +01:00
Jakub Jelinek 0e3438689a re PR c++/77914 (Wrong lambda definition accepted)
PR c++/77914
	* parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
	OPT_Wpedantic on lambda templates for -std=c++14 and higher.

	* g++.dg/cpp1y/lambda-generic-77914.C: New test.
	* g++.dg/cpp1y/lambda-generic-dep.C: Add -pedantic to dg-options,
	expect a warning.
	* g++.dg/cpp1y/lambda-generic-x.C: Add -Wpedantic to dg-options,
	expect warnings.
	* g++.dg/cpp1y/lambda-generic-mixed.C: Add empty dg-options.
	* g++.dg/cpp1y/pr59636.C: Likewise.
	* g++.dg/cpp1y/pr60190.C: Likewise.

From-SVN: r244907
2017-01-25 21:51:10 +01:00
Bin Cheng 0d098f4ba1 vect-24.c: Remove xfail on ARM targets.
gcc/testsuite
	* gcc.dg/vect/vect-24.c: Remove xfail on ARM targets.

From-SVN: r244905
2017-01-25 17:07:30 +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
Christophe Lyon ed4e59f46f [ARM][testsuite] Force -mcpu=cortex-a57 for vsel* tests.
2017-01-25  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.target/arm/vseleqdf.c: Require arm_arch_v8a_ok, add
	-mcpu=cortex-a57.
	* gcc.target/arm/vseleqsf.c: Likewise.
	* gcc.target/arm/vselgedf.c: Likewise.
	* gcc.target/arm/vselgesf.c: Likewise.
	* gcc.target/arm/vselgtdf.c: Likewise.
	* gcc.target/arm/vselgtsf.c: Likewise.
	* gcc.target/arm/vselledf.c: Likewise.
	* gcc.target/arm/vsellesf.c: Likewise.
	* gcc.target/arm/vselltdf.c: Likewise.
	* gcc.target/arm/vselltsf.c: Likewise.
	* gcc.target/arm/vselnedf.c: Likewise.
	* gcc.target/arm/vselnesf.c: Likewise.
	* gcc.target/arm/vselvcdf.c: Likewise.
	* gcc.target/arm/vselvcsf.c: Likewise.
	* gcc.target/arm/vselvsdf.c: Likewise.
	* gcc.target/arm/vselvssf.c: Likewise.

From-SVN: r244903
2017-01-25 16:41:55 +01:00
Richard Biener a5d6927fef re PR testsuite/72850 (FAIL: gcc.dg/tree-ssa/pr69270-3.c scan-tree-dump-times uncprop1 ", 1" 4)
2017-01-25  Richard Biener  <rguenther@suse.de>

	PR testsuite/72850
	* gcc.dg/tree-ssa/pr69270-3.c: Change back expected outcome
	to what we had before adding the threading passes.

From-SVN: r244898
2017-01-25 13:14:41 +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
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
Kyrylo Tkachov 9078cd3665 [testsuite] Require shared effective target for some lto.exp tests
* gcc.dg/lto/pr54709_0.c: Require 'shared' effective target.
	* gcc.dg/lto/pr61526_0.c: Likewise.
	* gcc.dg/lto/pr64415_0.c: Likewise.

From-SVN: r244891
2017-01-25 09:24:49 +00:00
Jakub Jelinek 7cfd79d60b re PR c++/79205 (ICE in create_tmp_var, at gimple-expr.c:473)
PR c++/79205
	* cp-gimplify.c (cp_genericize_r): Add result of
	convert_from_reference on invisiref parm to p_set.

	* g++.dg/cpp1z/decomp22.C: New test.
	* g++.dg/cpp1z/decomp23.C: New test.

From-SVN: r244885
2017-01-24 23:33:41 +01:00
Nathan Sidwell 1d7bc790d7 PR c++/78469 - defaulted ctor and inaccessible dtor
PR c++/78469 - defaulted ctor and inaccessible dtor
	* cp-tree.h (tsubst_flags): Add tf_no_cleanup.
	* init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
	* tree.c (build_target_expr): Check tf_no_cleanup.

	PR c++/78469
	* g++.dg/cpp0x/pr78469.C: New.

From-SVN: r244882
2017-01-24 19:29:44 +00:00
Nathan Sidwell 3e4b91f275 PR c++/79118 - anon-members and constexpr
PR c++/79118 - anon-members and constexpr
	* constexpr.c (cx_check_missing_mem_inits): Caller passes type not
	ctor decl.  Recursively check anonymous members.
	(register_constexpr_fundef): Adjust cx_check_missing_mem_inits
	call.
	(explain_invalid_constexpr_fn): Likewise.


	PR c++/79118
	* g++.dg/cpp0x/pr79118.C: New.

From-SVN: r244881
2017-01-24 19:25:32 +00: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
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
Jakub Jelinek c3b3e526fd asan_test.C: Enable on all *-*-linux* targets that support asan...
* g++.dg/asan/asan_test.C: Enable on all *-*-linux* targets that
	support asan, only on i?86/x86_64 require sse2_runtime.

From-SVN: r244856
2017-01-24 09:27:39 +01:00
Kelvin Nilsen 75f921278e re PR rtl-optimization/66669 (FAIL: gcc.dg/loop-8.c)
gcc/testsuite/ChangeLog:

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

	PR target/66669
	* gcc.dg/loop-8.c: Modify dg-skip-if directive to exclude this
	test on powerpc targets.

From-SVN: r244850
2017-01-24 01:26:13 +00:00
Martin Sebor 1a998fa0b7 builtin-sprintf.c: Add test cases.
gcc/testsuite/ChangeLog:
	* gcc.dg/tree-ssa/builtin-sprintf.c: Add test cases.

From-SVN: r244848
2017-01-23 18:12:41 -07: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
Nathan Sidwell fc7612fd02 PR c++/71710 - template using directive of field
PR c++/71710 - template using directive of field
	* pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
	check earlier.

	PR C++/71710
	* g++.dg/template/pr71710.C: New.

From-SVN: r244833
2017-01-23 20:24:32 +00:00
Nathan Sidwell e6b8075cce PR c++/71406 - ICE with scope-ref'd template id exprs
PR c++/71406 - ICE with scope-ref'd template id exprs
	PR c++/77508
	* typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
	before breaking up TEMPLATE_ID_EXPR.

	PR c++/71406
	PR c++/77508
	* g++.dg/template/pr71406.C: New.

From-SVN: r244832
2017-01-23 20:19:07 +00:00
Thomas Koenig 15b8fd499d arith.c (arith_power): If simplifying integer power expression to zero...
2017-01-23  Thomas Koenig  <tkoenig@netcologne.de>

	* arith.c (arith_power):  If simplifying integer power expression
	to zero, warn if -Winteger-division is given.

2017-01-23  Thomas Koenig  <tkoenig@netcologne.de>

	* gfortran.dg/integer_exponentiation_7.f90:  New test.

From-SVN: r244830
2017-01-23 19:43:28 +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
Richard Biener 050116183b re PR testsuite/78421 (vect-strided-a-u8-i2-gap.c fails on armeb)
PR testsuite/78421
	* lib/target-supports.exp (check_effective_target_vect_hw_misalign):
	If the target is ARM return the result of the
	check_effective_target_arm_vect_no_misalign proc.
	* gcc.dg/vect/vect-strided-a-u8-i2-gap.c: If the target does not
	support unaligned vectors then only expect one of the loops to be
	unrolled.

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

From-SVN: r244796
2017-01-23 12:24:35 +00:00
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
Kyrylo Tkachov d8ae8d1601 [testsuite] Fix FAIL: gcc.dg/lto/pr69188 on bare-metal targets
PR lto/69188
	* gcc.dg/lto/pr69188_0.c: Require profiling support for testcase.

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

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

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

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

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

From-SVN: r244763
2017-01-22 20:36:57 +01:00
Andreas Schwab bc4d86e626 * gcc.dg/tree-ssa/pr77445-2.c: Quote brackets.
From-SVN: r244757
2017-01-22 12:46:39 +00:00
Marek Polacek c31d5fcecf re PR testsuite/79169 (g++.dg/warn/Wduplicated-branches1.C fails on powerpc since its introduction in r244705)
PR testsuite/79169
	* g++.dg/warn/Wduplicated-branches1.C: Use signed char.

From-SVN: r244747
2017-01-21 12:00:40 +00:00
Jan Hubicka 25cb56c3a0 * gcc.dg/tree-ssa/pr77445-2.c: Adjust template.
From-SVN: r244746
2017-01-21 11:33:44 +00:00
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
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
Nathan Sidwell 4b9f211511 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
PR c++/78495 - wrong code inherited ctor and invisi-ref parm
	* cp-gimplify.c (cp_generize_r): Don't skip thunks.

	PR c++/79495
	* g++.dg/cpp1z/inh-ctor38.C: New.

From-SVN: r244728
2017-01-20 17:53:44 +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
Thomas Preud'homme 449cd5af04 Skip optional_mthumb tests if GCC has a default mode
2017-01-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/testsuite/
    * lib/target-supports.exp (check_configured_with): New procedure.
    (check_effective_target_default_mode): new effective target.
    * gcc.target/arm/optional_thumb-1.c: Skip if GCC was configured with a
    default mode.  Fix dg-skip-if target selector syntax.
    * gcc.target/arm/optional_thumb-2.c: Likewise.
    * gcc.target/arm/optional_thumb-3.c: Fix dg-skip-if target selector
    syntax.

From-SVN: r244723
2017-01-20 15:29:21 +00:00
David Malcolm ebed71751b C++: fix fix-it hints for misspellings within explicit namespaces
gcc/cp/ChangeLog:
	PR c++/77829
	PR c++/78656
	* cp-tree.h (suggest_alternatives_for): Add bool param.
	(suggest_alternative_in_explicit_scope): New decl.
	* error.c (qualified_name_lookup_error): When SCOPE is a namespace
	that isn't the global one, call new function
	suggest_alternative_in_explicit_scope, only calling
	suggest_alternatives_for if it fails, and disabling near match
	searches fort that case.  When SCOPE is the global namespace,
	pass true for new param to suggest_alternatives_for to allow for
	fuzzy name lookups.
	* lex.c (unqualified_name_lookup_error): Pass true for new param
	to suggest_alternatives_for.
	* name-lookup.c (consider_binding_level): Add forward decl.
	(suggest_alternatives_for): Add "suggest_misspellings" param,
	using it to conditionalize the fuzzy name-lookup code.
	(suggest_alternative_in_explicit_scope): New function.
	* parser.c (cp_parser_primary_expression): When calling
	finish_id_expression, pass location of id_expression rather
	than that of id_expr_token.
	(cp_parser_id_expression): Convert local "unqualified_id" from
	tree to cp_expr to avoid implicitly dropping location information.

gcc/testsuite/ChangeLog:
	PR c++/77829
	PR c++/78656
	* g++.dg/spellcheck-pr77829.C: New test case.
	* g++.dg/spellcheck-pr78656.C: New test case.

From-SVN: r244715
2017-01-20 14:36:46 +00: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
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
Richard Biener 0516164b36 re PR tree-optimization/71264 (ICE in convert_move)
2017-01-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71264
	* gcc.dg/vect/pr71264.c: Make sure memory is aligned.

From-SVN: r244683
2017-01-20 08:01:27 +00: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 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
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
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
Rainer Orth c048038f8d Fix gcc.dg/attr-alloc_size-4.c on i?86 (PR testsuite/79051)
PR testsuite/79051
	* gcc.dg/attr-alloc_size-4.c (test_int_range) [__i386__ ||
	__x86_64__]: Allow for target i?86-*-*.

From-SVN: r244647
2017-01-19 17:42:50 +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
Andre Vehreschild 118d5ed321 re PR fortran/70696 ([Coarray] ICE on EVENT POST of host-associated EVENT_TYPE coarray)
gcc/fortran/ChangeLog:

2017-01-19  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/70696
	* trans-decl.c (gfc_build_qualified_array): Add static decl to parent
	function only, when the decl-context is not the translation unit.

gcc/testsuite/ChangeLog:

2017-01-19  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/70696
	* gfortran.dg/coarray_43.f90: New test.

From-SVN: r244637
2017-01-19 16:52:32 +01: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
Michael Meissner 54dc4be290 p9-xxbr-1.c: Fix typos in submission.
2017-01-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/powerpc/p9-xxbr-1.c: Fix typos in submission.
	* gcc.target/powerpc/p9-xxbr-2.c: Likewise.

From-SVN: r244605
2017-01-19 00:12:14 +00:00
Louis Krupp 7bd5dad249 re PR fortran/50069 (FORALL fails on a character array)
2017-01-18  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/50069
	PR fortran/55086
	* gfortran.dg/pr50069_1.f90: New test.
	* gfortran.dg/pr50069_2.f90: New test.
	* gfortran.dg/pr55086_1.f90: New test.
	* gfortran.dg/pr55086_1_tfat.f90: New test.
	* gfortran.dg/pr55086_2.f90: New test.
	* gfortran.dg/pr55086_2_tfat.f90: New test.
	* gfortran.dg/pr55086_aliasing_dummy_4_tfat.f90: New test.

2017-01-18  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/50069
	PR fortran/55086
	* trans-expr.c (gfc_conv_variable): Don't treat temporary variables
	as function arguments.
	* trans-stmt.c (forall_make_variable_temp,
	generate_loop_for_temp_to_lhs, gfc_trans_assign_need_temp,
	gfc_trans_forall_1): Don't adjust offset of forall temporary
	for array sections, make forall temporaries work for substring
	expressions, improve test coverage by adding -ftest-forall-temp
	option to request usage of temporary array in forall code.
	* lang.opt: Add -ftest-forall-temp option.
	* invoke.texi: Add -ftest-forall-temp option.

From-SVN: r244601
2017-01-18 21:41:48 +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
David Malcolm 551914b748 jit.dg: fix issue with compilation of test-threads.c
DejaGnu's <dejagnu.h> provides decls of various inline functions,
of which the jit testsuite uses "pass", "fail" and "note".

The jit testcase test-threads.c jumps through some hoops to make
these functions threadsafe, using macros to rename the implementation
in dejagnu.h, giving them a "dejagnu_" prefix, then reimplementing
the names with wrappers that use a mutex.

The DejaGnu functions gained a "static" modifier in
ad36659ffa984a0541cfc2bd27f393e0d7d173a7, which appears to be in
DejaGnu 1.5.2 onwards.

Unfortunately, jit.dg/test-threads.c has forward decls of
"dejagnu_pass" etc, and these don't have "static", leading to conflicts
with later versions of DejaGnu for which "pass" etc have "static".

This patch fixes things by removing the forward decls of
"dejagnu_pass", moving the usage of them to a point at which dejagnu.h
has been included, which ought to work with both earlier and later
versions of DejaGnu.

Fixes compilation of test-threads.c in jit testsuite.

gcc/testsuite/ChangeLog:
	* jit.dg/test-threads.c (dejagnu_pass): Remove decl.
	(dejagnu_fail): Likewise.
	(dejagnu_note): Likewise.
	(pass): Provide forward decl, moving true decl to after #include
	of harness.h.
	(fail): Likewise.
	(note): Likewise.

From-SVN: r244597
2017-01-18 20:47:12 +00: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
Nathan Sidwell c484627cf6 re PR c++/78488 (P0136R1 ICE when building call to inherited default constructor.)
PR c++/78488
	* call.c (build_over_call): When checking ellipsis conversions for
	an inherited ctor, make sure there is at least one conversion.

	* g++.dg/cpp1z/inh-ctor37.C: New.

From-SVN: r244592
2017-01-18 19:27:52 +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
Andre Vehreschild 525a5e33b5 coarray_alloc_with_implicit_sync_2.f90: New test.
gcc/testsuite/ChangeLog:

2017-01-18  Andre Vehreschild  <vehre@gcc.gnu.org>

	* gfortran.dg/coarray_alloc_with_implicit_sync_2.f90: New test.

Also fixed date in gcc/testsuite/ChangeLog on my previous commit.

gcc/fortran/ChangeLog:

2017-01-18  Andre Vehreschild  <vehre@gcc.gnu.org>

	* primary.c (caf_variable_attr): Improve figuring whether the current
	component is the last one refed.
	* trans-stmt.c (gfc_trans_allocate): Do not generate sync_all calls
	when allocating pointer or allocatable components.

From-SVN: r244590
2017-01-18 20:03:21 +01:00
Andre Vehreschild 3083fc562e re PR fortran/70696 ([Coarray] ICE on EVENT POST of host-associated EVENT_TYPE coarray)
gcc/fortran/ChangeLog:

2017-01-17  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/70696
	Missed some parts, here they are:
	* trans-decl.c (gfc_build_qualified_array): Add static tokens to the
	parent function's scope.
	* trans-expr.c (gfc_get_tree_for_caf_expr): Shorten code.  Remove
	unnecessary assert.

gcc/testsuite/ChangeLog:

2017-01-17  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/70696
	* gfortran.dg/coarray_event_1.f08: New test.

From-SVN: r244587
2017-01-18 19:35:41 +01:00
Jakub Jelinek 90553aacf8 re PR rtl-optimization/77416 (LRA rematerializing use of CA reg across function call)
PR target/77416
	* gcc.target/powerpc/pr77416.c Guard the test only for ilp32 effective
	target.  Use powerpc* instead of powerpc64* in targets.  Remove -m32
	from dg-options.
	* gcc.target/powerpc/pr64205.c: Remove -m32 from dg-options of ilp32
	guarded test.
	* gcc.target/powerpc/fusion4.c: Likewise.
	* gcc.target/powerpc/pr63491.c: Remove -m64 from dg-options of lp64
	guarded test.
	* gcc.target/powerpc/pr58673-1.c: Likewise.
	* gcc.target/powerpc/pr58673-2.c: Likewise.
	* gcc.target/powerpc/pr59054.c: Likewise.

From-SVN: r244585
2017-01-18 18:39:56 +01: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
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
Nathan Sidwell 2c65d990eb re PR c++/79091 (ICE in write_unnamed_type)
PR c++/79091
	* mangle.c (write_exception_spec): Check nothrow explicitly.
	(write_encoding): Don't increment processing_template_decl around
	encoding.

	PR c++/79091
	* g++.dg/pr79091.C: New.

From-SVN: r244575
2017-01-18 12:51:28 +00:00
Joe Seymour 4701fba31c t-msp430 (LIB2ADD): Remove mpy.c
libgcc/
	* config/msp430/t-msp430 (LIB2ADD): Remove mpy.c
	(mpy.o): New rule.
	(libmul_none.a): Add mpy.o

	gcc/testsuite/
	* gcc.target/msp430/mul_f5_muldef.c: New test.

From-SVN: r244564
2017-01-17 22:56:10 -05:00
Michael Meissner ac4dc08d72 re PR target/79004 (ICE in gcc.dg/torture/fp-int-convert-float128-ieee.c with -mcpu=power9)
2017-01-17  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79004
	* gcc.target/powerpc/pr79004.c: Add -mfloat128 to the test
	options.  Fix up the syntax for using \m and \M.

From-SVN: r244561
2017-01-18 00:35:29 +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
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
Nathan Sidwell 8ddfdbc265 re PR c++/61636 (generic lambda: segfault / "cannot call member function without object")
PR c++/61636
	* cp-tree.h (maybe_generic_this_capture): Declare.
	* lambda.c (resolvable_dummy_lambda): New, broken out of ...
	(maybe_resolve_dummy): ... here.  Call it.
	(maybe_generic_this_capture): New.
	* parser.c (cp_parser_postfix_expression): Speculatively capture
	this in generic lambda in unresolved member function call.
	* pt.c (tsubst_copy_and_build): Force hard error from failed
	member function lookup in generic lambda.

	PR c++/61636
	* g++.dg/cpp1y/pr61636-1.C: New.
	* g++.dg/cpp1y/pr61636-2.C: New.
	* g++.dg/cpp1y/pr61636-3.C: New.

From-SVN: r244544
2017-01-17 18:22:34 +00:00
Martin Sebor d365b403e2 PR testsuite/79115 - FAIL: gcc.dg/pr78768.c execution test on arm, aarch64
gcc/testsuite/ChangeLog
	* gcc.dg/pr78768.c: Make it a link-only test.

From-SVN: r244537
2017-01-17 09:36:55 -07:00
David Malcolm 0d80ab91d0 Fix wording of -Wmisleading-indentation (PR c++/71497)
gcc/c-family/ChangeLog:
	PR c++/71497
	* c-indentation.c (warn_for_misleading_indentation): Use the past
	subjunctive in the note.

gcc/testsuite/ChangeLog:
	PR c++/71497
	* c-c++-common/Wmisleading-indentation-3.c: Update wording of
	expected messages.
	* c-c++-common/Wmisleading-indentation.c: Likewise.

From-SVN: r244536
2017-01-17 16:33:44 +00: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
Jakub Jelinek c549996eed re PR tree-optimization/71854 (ICE at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (verify_gimple failed))
PR tree-optimization/71854
	* gcc.dg/vect/pr71854.c: New test.

From-SVN: r244534
2017-01-17 16:50:24 +01: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