Commit Graph

29484 Commits

Author SHA1 Message Date
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
Jan Hubicka d4193b85ae re PR tree-optimization/77445 (Performance drop after r239219 on coremark test)
PR middle-end/77445
	* tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges):
	correctly set frequency of oudgoing edge.
	(duplicate_thread_path): Fix profile updating.
	* gcc.dg/tree-ssa/pr77445-2.c: New testcase.
	* gcc.dg/tree-ssa/pr77445.c: New testcase.

From-SVN: r244528
2017-01-17 12:49:41 +00:00
Jakub Jelinek 906e771270 ssa-dse-2.C (size_t): Typedef to __SIZE_TYPE__ rather than long unsigned int.
* g++.dg/tree-ssa/ssa-dse-2.C (size_t): Typedef to __SIZE_TYPE__
	rather than long unsigned int.
	* g++.dg/tree-ssa/ssa-dom.C: Likewise.

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

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

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

From-SVN: r244520
2017-01-17 08:38:59 +00:00
Richard Biener a23e48df45 re PR testsuite/52563 (FAIL: gcc.dg/tree-ssa/scev-[3,4].c scan-tree-dump-times optimized "&a" 1)
2017-01-17  Richard Biener  <rguenther@suse.de>

	PR testsuite/52563
	PR testsuite/71237
	PR testsuite/77737
	* gcc.dg/tree-ssa/scev-3.c: Re-write to a GIMPLE testcase for IVOPTs.
	* gcc.dg/tree-ssa/scev-4.c: Likewise.
	* gcc.dg/tree-ssa/scev-5.c: Likewise.

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

From-SVN: r244515
2017-01-17 13:24:11 +10:30
Jeff Law a59afbe2fe re PR tree-optimization/79090 (DSE wrongly removes store at variable offset)
2017-01-16  Jeff Law  <law@redhat.com>

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

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

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

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

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

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

From-SVN: r244506
2017-01-16 22:34:35 +01:00
David Malcolm 0ef1f9cd8c Fix testcases for PR c/78304
The testcases as written made assumptions about size_t and long
being invalid for use with "%u".

We only need some invalid type, so this patch converts them to
attempt a "const char *" with "%u", which should be invalid for
every target.

gcc/testsuite/ChangeLog:
	PR c/78304
	* gcc.dg/format/pr78304.c: Convert argument from integral type
	to a pointer.
	* gcc.dg/format/pr78304-2.c: Likewise.

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

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

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

gcc/testsuite/ChangeLog:

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

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

From-SVN: r244501
2017-01-16 17:18:05 +00:00
Carl Love ce12ee9e68 builtins-3-p9.c (test_ne_long()): Change arguments and return type to bool long long.
gcc/testsuite/ChangeLog:

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

	* gcc.target/powerpc/builtins-3-p9.c (test_ne_long()):
	Change arguments and return type to bool long long.

From-SVN: r244499
2017-01-16 17:03:14 +00:00
Martin Sebor b336037ddc PR testsuite/79051 - FAIL: gcc.dg/attr-alloc_size-4.c (test for warnings, line 140)
gcc/testsuite/ChangeLog:
	* gcc.dg/attr-alloc_size-4.c: Avoid exercising a test case except
	on x86.

From-SVN: r244497
2017-01-16 08:50:47 -07:00
Paolo Carlini 1ddca3f365 revert: re PR c++/71737 (ICE following 2x pack expansion in non-pack with template alias)
/c-family
2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

	Revert:
     	2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71737
	* c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE.

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

	Revert:
        2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r244496
2017-01-16 15:43:06 +00:00
Bill Schmidt 290687fb4e rs6000.c (rtx_is_swappable_p): Change UNSPEC_VSX__XXSPLTD to require special splat handling.
[gcc]

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

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

[gcc/testsuite]

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

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

From-SVN: r244495
2017-01-16 15:05:35 +00:00
Paolo Carlini 7d2f3f1d29 re PR c++/71737 (ICE following 2x pack expansion in non-pack with template alias)
/c-family
2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71737
	* c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE.

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

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

From-SVN: r244486
2017-01-16 09:09:30 +00:00
Eric Botcazou d743728f90 opt62.adb: New test.
* gnat.dg/opt62.adb: New test.
	* gnat.dg/opt62_pkg.ads: New helper.

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

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

From-SVN: r244467
2017-01-14 09:52:18 -07:00
Alan Modra afaecc23b5 Testcase from pr72749
PR target/72749
	* gcc.c-torture/compile/pr72749.c: New test.

From-SVN: r244466
2017-01-14 23:59:29 +10:30
Janne Blomqvist c1e9bbcc49 Revert r244448
From-SVN: r244454
2017-01-13 21:53:16 +02:00
David Malcolm be4aa83d6f Don't suppress bogus usage of macros from system headers in -Wformat (PR c/78304)
gcc/ChangeLog:
	PR c/78304
	* substring-locations.c (format_warning_va): Strengthen case 1 so
	that both endpoints of the substring must be within the format
	range for just the substring to be printed.

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

From-SVN: r244453
2017-01-13 19:27:43 +00:00