Commit Graph

29904 Commits

Author SHA1 Message Date
Richard Biener da2ce5f993 re PR tree-optimization/80122 (__builtin_va_arg_pack() and __builtin_va_arg_pack_len() does not work correctly)
2017-03-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80122
	* tree-inline.c (copy_bb): Do not expans va-arg packs or
	va_arg_pack_len when the inlined call stmt requires pack
	expansion itself.
	* tree-inline.h (struct copy_body_data): Make call_stmt a gcall *.

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

From-SVN: r246313
2017-03-21 11:42:22 +00:00
Toma Tabacu 9d60683aa0 Skip gcc.dg/pic-2.c and gcc.dg/pie-2.c for MIPS.
gcc/testsuite/

	* gcc.dg/pic-2.c: Skip for MIPS.
	* gcc.dg/pie-2.c: Skip for MIPS.

From-SVN: r246311
2017-03-21 11:07:19 +00:00
Paolo Carlini d3e19c2c97 re PR c++/77752 (ICE on C++ code on x86_64-linux-gnu (internal compiler error: Segmentation fault, build_list_conv, implicit_conversion))
/cp
2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/77752
	* name-lookup.c (pushtag_1): Add check for bogus, non template,
	std::initializer_list.

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

	PR c++/77752
	* g++.dg/cpp0x/initlist97.C: New.
	* g++.dg/cpp0x/initlist85.C: Update.

From-SVN: r246310
2017-03-21 10:18:51 +00:00
Jakub Jelinek 9f30dff0ee re PR middle-end/67338 (fold-const sanitizer runtime error in roundup_loc)
PR c/67338
	* fold-const.c (round_up_loc): Negate divisor in unsigned type to
	avoid UB.

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

From-SVN: r246305
2017-03-21 09:10:30 +01:00
Jakub Jelinek 8bee092e7f re PR c++/35878 ([LWG 2302] Useless NULL pointer check when constructing object)
PR c++/35878
	* init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.

	* g++.dg/init/pr35878_1.C: Rewrite directives to scan optimized
	dump instead of assembler.
	* g++.dg/init/pr35878_2.C: Likewise.
	* g++.dg/init/pr35878_3.C: Likewise.

From-SVN: r246303
2017-03-21 08:30:48 +01:00
Jakub Jelinek 4d1b8e70fa re PR c/80097 (internal compiler error in c_fully_fold_internal with std=c89 and -fsanitize=float-divide-by-zero)
PR c/80097
	* c-typeck.c (build_binary_op): Add EXCESS_PRECISION_EXPR only around
	optional COMPOUND_EXPR with ubsan instrumentation.

	* gcc.dg/ubsan/pr80097.c: New test.

From-SVN: r246302
2017-03-21 08:01:05 +01:00
Bill Schmidt c34923c44c re PR tree-optimization/80054 (ICE in verify_ssa with -O3 -march=broadwell/skylake-avx512)
[gcc]

2017-03-20  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/80054
	* gimple-ssa-strength-reduction.c (all_phi_incrs_profitable): Fail
	the optimization if a PHI or any of its arguments is not dominated
	by the candidate's basis.  Use gphi* rather than gimple* as
	appropriate.
	(replace_profitable_candidates): Clean up a gimple* variable that
	should be a gphi* variable.

[gcc/testsuite]

2017-03-20  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/80054
	* g++.dg/torture/pr80054.C: New file.

From-SVN: r246290
2017-03-20 20:04:25 +00:00
Kelvin Nilsen b0ba96c2f1 re PR target/79963 (vec_eq_any extracts wrong CR bit when compiling with -mcpu=power9)
gcc/testsuite/ChangeLog:

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

	PR target/79963
	* gcc.target/powerpc/vsu/vec-any-eq-10.c: Add scan-assembler
	directive to assure selection of proper bit using rlwinm insn.
	* gcc.target/powerpc/vsu/vec-any-eq-14.c: Likewise.
	* gcc.target/powerpc/vsu/vec-any-eq-7.c: Likewise.
	* gcc.target/powerpc/vsu/vec-any-eq-8.c: Likewise.
	* gcc.target/powerpc/vsu/vec-any-eq-9.c: Likewise.

gcc/ChangeLog:

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

	PR target/79963
	* config/rs6000/altivec.h (vec_all_ne): Under __cplusplus__ and
	__POWER9_VECTOR__ #ifdef control, change template definition to
	use Power9-specific built-in function.
	(vec_any_eq): Likewise.
	* config/rs6000/vector.md (vector_ae_v2di_p): Change the flag used
	to control outcomes from this test.
	(vector_ae_<mode>p): For VEC_F modes, likewise.

From-SVN: r246287
2017-03-20 18:05:00 +00:00
Marek Polacek 92377255c1 PR c++/80059 - ICE with noexcept and __transaction_atomic
PR c++/80059 - ICE with noexcept and __transaction_atomic
	* except.c (build_must_not_throw_expr): Call
	instantiate_non_dependent_expr_sfinae.

	* g++.dg/tm/pr80059-2.C: New test.
	* g++.dg/tm/pr80059.C: New test.

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>

From-SVN: r246279
2017-03-20 15:02:09 +00:00
Martin Liska 243e28bfb9 MPX: fix PR middle-end/79753
2017-03-20  Martin Liska  <mliska@suse.cz>

	PR middle-end/79753
	* tree-chkp.c (chkp_build_returned_bound): Do not build
	returned bounds for a LHS that's not a BOUNDED_P type.
2017-03-20  Martin Liska  <mliska@suse.cz>

	PR middle-end/79753
	* gcc.target/i386/mpx/pr79753.c: New test.

From-SVN: r246276
2017-03-20 10:06:00 +00:00
Martin Liska 918112d378 Fix *_CST ICEs connected to MPX.
2017-03-20  Martin Liska  <mliska@suse.cz>

	PR target/79769
	PR target/79770
	* tree-chkp.c (chkp_find_bounds_1): Handle REAL_CST,
	COMPLEX_CST and VECTOR_CST.
2017-03-20  Martin Liska  <mliska@suse.cz>

	PR target/79769
	PR target/79770
	* g++.dg/pr79769.C: New test.
	* gcc.target/i386/mpx/pr79770.c: New test.

From-SVN: r246275
2017-03-20 10:04:06 +00:00
Andreas Krebbel e325aba2a7 S/390: PR78857: Don't use load and test if result is live.
The FP load and test instruction should not be used for a comparison
if the target operand is being used afterwards.  It unfortunately
turns SNaNs into QNaNs.

gcc/ChangeLog:

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

	PR target/78857
	* config/s390/s390.md ("cmp<mode>_ccs_0"): Add a clobber of the
	target operand.  A new splitter adds the clobber statement in case
	the target operand is dead anyway.

gcc/testsuite/ChangeLog:

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

	PR target/78857
	* gcc.target/s390/load-and-test-fp-1.c: New test.
	* gcc.target/s390/load-and-test-fp-2.c: New test.

From-SVN: r246274
2017-03-20 09:33:11 +00:00
Paul Thomas 91d2c04ced re PR fortran/79676 ([submodules] Compilation/linking error when module procedures PRIVATE)
2017-03-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/79676
	* module.c (mio_symbol_attribute): Remove reset of the flag
	'no_module_procedures'.
	(check_for_module_procedures): New function. Move declaration
	of 'no_module_procedures' to above it.
	(gfc_dump_module): Traverse namespace calling new function.

2017-03-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/79676
	* gfortran.dg/submodule_28.f08 : New test.

From-SVN: r246256
2017-03-18 12:38:02 +00:00
Paul Thomas c7e4107b53 re PR fortran/71838 (ICE with OpenCoarrays on submodule)
2017-03-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/71838
	* symbol.c (check_conflict): A dummy procedure in a submodule,
	module procedure is not an error.
	(gfc_add_flavor): Ditto.

2017-03-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/71838
	* gfortran.dg/submodule_26.f08 : New test.
	* gfortran.dg/submodule_27.f08 : New test.

From-SVN: r246255
2017-03-18 11:53:53 +00:00
Pat Haugen d8fe28be76 re PR target/79951 (ICE in extract_insn, at recog.c:2311 on ppc64le with -mno-cmpb)
PR target/79951
	* config/rs6000/rs6000.md (copysign<mode>3_fcpsgn): Test
	for VECTOR_UNIT_VSX_P (<MODE>mode) too.
	* gcc.target/powerpc/pr79951.c: New.

From-SVN: r246228
2017-03-17 16:42:29 +00:00
Bernd Schmidt 4a17943d36 re PR rtl-optimization/79910 (wrong code with -O -fweb)
PR rtl-optimization/79910
	* combine.c (record_used_regs): New static function.
	(try_combine): Handle situations where there is an additional
	instruction between I2 and I3 which needs to have a LOG_LINK
	updated.

	PR rtl-optimization/79910
	* gcc.dg/torture/pr79910.c: New test.

From-SVN: r246226
2017-03-17 09:10:13 -06:00
Jeff Law 7f166d9447 re PR tree-optimization/71437 (Performance regression after r235817)
PR tree-optimization/71437
	* tree-vrp.c (simplify_stmt_for_jump_threading): Lookup the
	conditional in the hash table first.
	(vrp_dom_walker::before_dom_children): Extract condition from
	ASSERT_EXPR.  Record condition, its inverion and any implied
	conditions as well.

	PR tree-optimization/71437
	* gcc.dg/tree-ssa/pr71437.c: New test.
	* gcc.dg/tree-ssa/20040305-1.c: Test earlier dump.
	* gcc.dg/tree-ssa/ssa-dom-thread-4.c: Adjust for jump threads
	now caught by VRP, but which were previously caught by DOM.

From-SVN: r246225
2017-03-17 09:01:56 -06:00
Richard Biener 12c4f7dcaf re PR c++/80075 (ICE: "statement marked for throw, but doesn’t" with -fnon-call-exceptions)
2017-03-17  Richard Biener  <rguenther@suse.de>

	PR middle-end/80075
	* tree-eh.c (stmt_could_throw_1_p): Only handle gimple assigns.
	Properly verify the LHS before the RHS possibly claims to be
	handled.
	(stmt_could_throw_p): Hande gimple conds fully here.  Clobbers
	do not throw.

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

From-SVN: r246223
2017-03-17 12:48:56 +00:00
Michael Meissner 207f34233c re PR target/71294 (ICE in gen_add2_insn, at optabs.c:4442 on powerpc64le-linux)
[gcc]
2017-03-16  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/71294
	* config/rs6000/vsx.md (vsx_splat_<mode>, VSX_D iterator): Allow a
	SPLAT operation on ISA 2.07 64-bit systems that have direct move,
	but no MTVSRDD support, by doing MTVSRD and XXPERMDI.

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

	PR target/71294
	* g++.dg/pr71294.C: New test.

From-SVN: r246209
2017-03-16 20:09:21 +00:00
Segher Boessenkool 9fc900af68 Fix tree-prof/pr66295.c
This testcase can only ever be built on x86 (it needs the "avx*"
attributes).  This patch skips the test elsewhere.


gcc/testsuite/
	* gcc.dg/tree-prof/pr66295.c: Skip unless on an x86 target.

From-SVN: r246206
2017-03-16 19:18:58 +01:00
Jakub Jelinek e711928b48 re PR fortran/80010 (diagnostics: typo $!)
PR fortran/80010
	* parse.c (gfc_ascii_statement): Use !$ACC for ST_OACC_ATOMIC
	and ST_OACC_END_ATOMIC, instead of !ACC.
	* trans-decl.c (finish_oacc_declare): Use !$ACC instead of $!ACC.
	* openmp.c (gfc_match_oacc_declare, gfc_match_oacc_wait,
	gfc_resolve_oacc_declare): Likewise.

	* gfortran.dg/goacc/asyncwait-3.f95: Adjust expected diagnostic.

From-SVN: r246204
2017-03-16 17:50:27 +01:00
Jakub Jelinek c05c238081 re PR fortran/79886 (ICE in pp_format, at pretty-print.c:681)
PR fortran/79886
	* tree-diagnostic.c (default_tree_printer): No longer static.
	* tree-diagnostic.h (default_tree_printer): New prototype.
fortran/
	* error.c (gfc_format_decoder): Rename plus argument to set_locus,
	remove ATTRIBUTE_UNUSED from all arguments, call default_tree_printer
	if not a Fortran specific spec.
	* trans-io.c: Include options.h.
	(gfc_build_st_parameter): Temporarily disable -Wpadded around layout
	of artificial IO data structures.
testsuite/
	* gfortran.dg/pr79886.f90: New test.

From-SVN: r246203
2017-03-16 17:27:08 +01:00
Michael Meissner 3231d64b5e re PR target/79038 (Improve PowerPC ISA 3.0 conversion between integers and hardware _Float128)
[gcc]
2017-03-15  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79038
	* config/rs6000/rs6000.md (float<QHI:mode><IEEE128:mode>2): Define
	insns to convert from signed/unsigned char/short to IEEE 128-bit
	floating point.
	(floatuns<QHI:mode><IEEE128:mode>2): Likewise.

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

	PR target/79038
	* gcc.target/powerpc/pr79038-1.c: New test.

From-SVN: r246178
2017-03-15 21:17:35 +00:00
Segher Boessenkool 81ef1f5e25 rs6000: Do not xfail nint_2.f90 on Linux systems
It was XFAILed because there was a bug in glibc, but that bug was fixed
nine years ago.  Nowadays everyone uses a version of glibc with the bug
fixed, so we should no longer XFAIL the test.


gcc/testsuite/
	PR fortran/33271
	* gfortran.dg/nint_2.f90: Do not xfail powerpc*-*-linux*.

From-SVN: r246174
2017-03-15 21:48:49 +01:00
Jiong Wang 395a1e9b5c [gcc, testsuite] Don't xfail on arm
PR testsuite/79356
	* gcc.dg/attr-alloc_size-11.c: Don't xfail on arm.

From-SVN: r246167
2017-03-15 15:33:12 +00:00
Uros Bizjak 05f659104f re PR target/80019 (ICE in ix86_vector_duplicate_value, at config/i386/i386.c:42584)
PR target/80019
	* config/i386/i386.c (ix86_vector_duplicate_value): Create
	subreg of inner mode for values already in registers.

testsuite/ChangeLog:

	PR target/80019
	* gcc.target/i386/pr80019.c: New test.

From-SVN: r246161
2017-03-15 14:38:51 +01:00
Martin Liska 94285a7d56 Removed unused dg-error.
2017-03-15  Martin Liska  <mliska@suse.cz>

	* gcc.dg/tree-prof/pr66295.c: Removed unused dg-error.

From-SVN: r246154
2017-03-15 10:06:10 +00:00
Martin Sebor a983542b60 re PR tree-optimization/79800 (wrong snprintf result range with precision in a narrow negative-positive range)
PR tree-optimization/79800
	* gimple-ssa-sprintf.c (format_floating: Add argument.  Handle
	precision in negative-positive range.
	(format_floating): Call non-const overload with adjusted precision.

	PR tree-optimization/79800
	* gcc.dg/tree-ssa/builtin-sprintf-warn-15.c: Add test cases.
	* gcc.dg/tree-ssa/pr79800.c: New test.

From-SVN: r246151
2017-03-14 22:31:27 -06:00
Michael Meissner 76ca5f401d re PR target/79947 (ICE in rs6000_emit_swsqrt at gcc/config/rs6000/rs6000.c:37570)
[gcc]
2017-03-14  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/79947
	* config/rs6000/rs6000.h (TARGET_FRSQRTES): Add check for
	-mpowerpc-gfxopt.

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

	PR target/79947
	* gcc.target/powerpc/pr79947.c: New test.

From-SVN: r246150
2017-03-15 00:25:10 +00:00
Martin Sebor 5d9a283ac6 re PR middle-end/80020 (gcc confused about aligned_alloc argument order)
PR middle-end/80020
	* builtin-attrs.def (ATTR_ALLOC_SIZE_2_NOTHROW_LIST): New macro.
	* builtins.def (aligned_alloc): Use it.

	PR middle-end/80020
	* gcc.dg/attr-alloc_size-6.c: Correct aligned_alloc argument order.
	* gcc.dg/attr-alloc_size-7.c: Same.
	* gcc.dg/attr-alloc_size-9.c: Same.
	* gcc.dg/builtin-alloc-size.c: Same.
	* gcc.dg/pr80020.c: New test.

From-SVN: r246145
2017-03-14 16:16:27 -06:00
Bernd Schmidt 4692943dac re PR rtl-optimization/79728 (ICE in setup_pressure_classes, at ira.c:912)
PR rtl-optimization/79728
	* regs.h (struct target_regs): New field
	x_contains_allocatable_regs_of_mode.
	(contains_allocatable_regs_of_mode): New macro.
	* reginfo.c (init_reg_sets_1): Initialize it, and change
	contains_reg_of_mode so it includes global regs as well.
	* reload.c (push_reload): Use contains_allocatable_regs_of_mode
	rather than contains_regs_of_mode.

	PR rtl-optimization/79728
	* gcc.target/i386/sse-globalreg.c: New test.

From-SVN: r246138
2017-03-14 11:50:46 -06:00
Martin Liska 861d9d5e6a Fix multiple target clones nodes (PR lto/66295).
2017-03-14  Martin Liska  <mliska@suse.cz>

	PR lto/66295
	* multiple_target.c (expand_target_clones): Drop local.local
	flag for default implementation.
2017-03-14  Martin Liska  <mliska@suse.cz>

	PR lto/66295
	* gcc.dg/tree-prof/pr66295.c: New test.

From-SVN: r246119
2017-03-14 11:59:59 +00:00
Martin Liska a48018b5dc Do not warn -Wsuggest-attribute=noreturn for main.chkp (PR middle-end/78339).
2017-03-13  Martin Liska  <mliska@suse.cz>

	PR middle-end/78339
	* ipa-pure-const.c (warn_function_noreturn): If the declarations
	is a CHKP clone, use original declaration.
2017-03-13  Martin Liska  <mliska@suse.cz>

	PR middle-end/78339
	* gcc.target/i386/mpx/pr78339.c: New test.

From-SVN: r246098
2017-03-13 15:30:17 +00:00
Claudiu Zissulescu 8c56cc5a88 [ARC] Fix tst_bitfield_tst pattern.
gcc/
2017-03-13  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.md (*tst_bitfield_tst): Fix pattern.

gcc/testsuite
2017-03-13  Claudiu Zissulescu  <claziss@synopsys.com>

	* testsuite/gcc.target/arc/bitfield.c: New file.

From-SVN: r246090
2017-03-13 13:56:11 +01:00
Claudiu Zissulescu 14555394f4 [ARC] Handle complex PIC move patterns.
fwprop step is placing in the REG_EQUIV notes constant pic unspecs
expressions.  Then, loop may use these notes for optimizations
rezulting in complex patterns that are not supported by the current
implementation.

The patch adds handling of complex PIC addresses having MINUS or UNARY
operations.

gcc/
2017-03-13  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_legitimize_pic_address): Handle PIC
	expressions with MINUS and UNARY ops.

gcc/testsuite
2017-03-13  Claudiu Zissulescu  <claziss@synopsys.com>

	* gcc.target/arc/pr9001090948.c: New file.

From-SVN: r246087
2017-03-13 13:55:38 +01:00
Segher Boessenkool 3079b92e34 rs6000, testsuite: Correct the broken_cplxf_arg test
check_effective_target_broken_cplxf_arg is buggy.  It actually tests
if passing complex float works, not if it fails.  Also, it only runs
the test for target powerpc64-linux, but we are biarch, so it should
be powerpc*-linux.

This also changes the early-out conditions to be separate, because
the big combined condition was hard to follow.

This fixes the libstdc++ tests:

Running target unix/-m64
XPASS: 26_numerics/complex/13450.cc execution test
XPASS: 26_numerics/complex/pow.cc execution test
XPASS: 26_numerics/complex/value_operations/1.cc execution test

which were the last failing libstdc++ tests on BE.


gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_broken_cplxf_arg):
	Fix test.  Make early-out condition return early.  Correct comments.

From-SVN: r246072
2017-03-12 01:04:02 +01:00
Jerry DeLisle c08de9db47 re PR fortran/78854 ([F03] DTIO namelist output not working on internal unit)
2017-03-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/78854
	* io/list_read.c (nml_get_obj_data): Stash internal unit for
	later use by child procedures.
	* io/write.c (nml_write_obj): Likewise.
	* io/tranfer.c (data_transfer_init): Minor whitespace.
	* io/unit.c (set_internal_uit): Look for the stashed internal
	unit and use it if found.

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

From-SVN: r246070
2017-03-11 14:49:57 +00:00
Martin Sebor 66b2754523 As discussed in https://gcc.gnu.org/ml/gcc-patches/2017-02/msg00942.html
gcc/testsuite/ChangeLog:
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Add a test case.

From-SVN: r246064
2017-03-10 17:33:45 -07:00
Bernd Schmidt 8f2f638160 re PR rtl-optimization/78911 (Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2)
PR rtl-optimization/78911
	* lra-assigns.c (must_not_spill_p): New function.
	(spill_for): Use it.

	PR rtl-optimization/78911
	* gcc.target/i386/pr78911-1.c: New test.
	* gcc.target/i386/pr78911-2.c: New test.

From-SVN: r246059
2017-03-10 21:17:13 +00:00
Will Schmidt 8e2c69b489 re PR target/79941 (Altivec vec_vmuleub regression)
gcc:
2017-03-10  Will Schmidt <will_schmidt@vnet.ibm.com>

     PR target/79941
     * config/rs6000/rs6000.c (builtin_function_type): Add VMUL*U[HB]
     entries to the case statement that marks unsigned arguments to
     overloaded functions.

testsuite:
2017-03-10  Will Schmidt <will_schmidt@vnet.ibm.com>

     PR target/79941
     * gcc.target/powerpc/fold-vec-mult-even_odd_misc.c: New test.
     * gcc.target/powerpc/fold-vec-mult-even_odd_char.c: New test.
     * gcc.target/powerpc/fold-vec-mult-even_odd_short.c: New test.

From-SVN: r246040
2017-03-10 16:18:44 +00:00
Marek Polacek 455d833cd8 re PR c++/79967 (ICE on non-type template argument declared noreturn)
PR c++/79967
	* decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.

	* g++.dg/cpp0x/gen-attrs-63.C: New test.

From-SVN: r246039
2017-03-10 15:36:00 +00:00
Jakub Jelinek e260b0a7dd re PR c++/79899 (ICE in ctor_omit_inherited_parms at gcc/cp/method.c:576 on ARM target)
PR c++/79899
	* optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
	Use XALLOCAVEC macro.

	* g++.dg/other/friend7.C: New test.

From-SVN: r246038
2017-03-10 16:33:04 +01:00
Jakub Jelinek cdd669f9fc re PR c++/79896 (ICE in gimplify_expr, at gimplify.c:11950 on non-int128 target)
PR c++/79896
	* decl.c (finish_enum_value_list): If value is error_mark_node,
	don't copy it and change its type.
	* init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
	of CONST_DECL is error_mark_node.

	* g++.dg/ext/int128-5.C: New test.

From-SVN: r246034
2017-03-10 16:28:26 +01:00
Segher Boessenkool 730e6e4634 testsuite: attr-alloc_size-11.c (PR79356)
As stated in the PR (and elsewhere), this test now passes on aarch64,
ia64, mips, powerpc, sparc, and s390x.  This patch disables the xfails
for those targets.


	PR testsuite/79356
	* gcc.dg/attr-alloc_size-11.c: Don't xfail on aarch64, ia64, mips,
	powerpc, sparc, or s390x.

From-SVN: r246032
2017-03-10 16:23:06 +01:00
Pat Haugen fc8f6304a9 re PR target/79907 (ICE in extract_constrain_insn, at recog.c:2213 on ppc64le)
PR target/79907
	* config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Test
	TARGET_UPPER_REGS_DI when setting 'wi' constraint regclass.
	* gcc.target/powerpc/pr79907.c: New.

From-SVN: r246029
2017-03-10 14:32:42 +00:00
Olivier Hainque f1b0632aab tree-switch-conversion (array_value_type): Start by resetting candidate type to it's main variant.
2017-03-10  Olivier Hainque  <hainque@adacore.com>

	* tree-switch-conversion (array_value_type): Start by resetting
	candidate type to it's main variant.

	testsuite/
	* gnat.dg/opt64.adb: New test.
	* gnat.dg/opt64_pkg.ads: New helper.
	* gnat.dg/opt64_pkg.adb: New helper.

From-SVN: r246024
2017-03-10 11:16:21 +00:00
Jakub Jelinek 2d9dd4fb86 re PR middle-end/79909 (ICE error: invalid rtl sharing found in the insn on ppc64le)
PR rtl-optimization/79909
	* combine.c (try_combine): Use simplify_replace_rtx on individual
	CALL_INSN_FUNCTION_USAGE elements instead of replace_rtx on copy_rtx
	of the whole CALL_INSN_FUNCTION_USAGE.

	* gcc.target/powerpc/pr79909.c: New test.

From-SVN: r246023
2017-03-10 08:57:45 +01:00
Jakub Jelinek 72772e6761 re PR tree-optimization/79972 (ICE in tree check: expected ssa_name, have var_decl in get_range_info, at tree-ssanames.c:377 w/ -Walloca -Wvla-larger-than=364854541)
PR tree-optimization/79972
	* gimple-ssa-warn-alloca.c (alloca_call_type): Only call
	get_range_info on SSA_NAMEs.  Formatting fixes.

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

From-SVN: r246022
2017-03-10 08:55:00 +01:00
Jakub Jelinek 5558f089e3 re PR tree-optimization/77975 (Missed optimization for some small constants)
PR tree-optimization/77975
	* tree-ssa-loop-niter.c (get_base_for): Allow phi argument from latch
	edge to be constant.
	(get_val_for): For constant x return it.  Formatting fix.
	(loop_niter_by_eval): Avoid pointless looping if the next iteration
	would use the same bases as the current one.

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

From-SVN: r246021
2017-03-10 08:53:57 +01:00
Marek Polacek 822a132cfb re PR c++/79962 (ICE nonnull_check_p on a function template with a type-dependent attribute nonnull)
PR c++/79962
	PR c++/79984
	* c-attribs.c (handle_nonnull_attribute): Save the result of default
	conversion to the attribute list.

	* c-c++-common/nonnull-3.c: New test.
	* g++.dg/warn/Wnonnull3.C: New test.

From-SVN: r246016
2017-03-09 22:45:39 +00:00