Commit Graph

29780 Commits

Author SHA1 Message Date
Jakub Jelinek e3e9e8ca83 re PR c++/79746 (Confusing -Wunused-but-set-parameter warning with virtual inheritance)
PR c++/79746
	* init.c (emit_mem_initializers): When not constructing vbases of
	abstract classes, mark arguments as read for
	-Wunused-but-set-parameter.

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

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

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

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

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

From-SVN: r245795
2017-02-28 23:39:11 +01:00
Eric Botcazou 7a1ae92374 re PR target/79749 (Many sparc testcases FAIL at -O0 with -fomit-frame-pointer)
PR target/79749
	* config/sparc/sparc.c (sparc_frame_pointer_required): Add missing
	condition on optimize for the leaf function test.

From-SVN: r245791
2017-02-28 22:15:54 +00:00
Uros Bizjak 2af0c3edd1 i386.c (print_reg): Error out for values of 8-bit size in invalid integer register.
* config/i386/i386.c (print_reg): Error out for values
	of 8-bit size in invalid integer register.

testsuite/ChangeLog:

	* gcc.target/i386/invsize-1.c: New test.

From-SVN: r245785
2017-02-28 19:03:16 +01:00
Martin Sebor 203ced0a77 PR tree-optimization/79691 - -Wformat-truncation suppressed by (and only by) -Og
gcc/ChangeLog:

	PR tree-optimization/79691
	* passes.def (pass_all_optimizations_g): Enable pass_sprintf_length.

gcc/testsuite/ChangeLog:

	PR tree-optimization/79691
	* gcc.dg/tree-ssa/pr79691.c: New test.

From-SVN: r245782
2017-02-28 09:59:16 -07:00
Jakub Jelinek 8a915b876a re PR target/79729 (ICE in ix86_print_operand, at config/i386/i386.c:18231)
PR target/79729
	* config/i386/i386.c (ix86_print_operand) <case 'R'>: Replace
	gcc_unreachable with output_operand_lossage.

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

From-SVN: r245781
2017-02-28 17:24:56 +01:00
Richard Biener 41aa3a3857 re PR tree-optimization/79740 (ICE on -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in VN_INFO_GET, at tree-ssa-sccvn.c:407 }))
2017-02-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79740
	* tree-ssa-sccvn.c (vn_nary_op_insert_into): Allow redundant
	inserts.
	(visit_nary_op): Insert the nary into the hashtable if we
	pattern-matched sth.
	* tree-ssa-pre.c (eliminate_insert): Robustify.

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

From-SVN: r245780
2017-02-28 15:32:24 +00:00
Richard Biener 587240d249 re PR c/79731 (ICE: verify_gimple failed)
2017-02-28  Richard Biener  <rguenther@suse.de>

	PR middle-end/79731
	* fold-const.c (decode_field_reference): Reject out-of-bound
	accesses.

	* c-c++-common/torture/pr79731.c: New testcase.

From-SVN: r245779
2017-02-28 15:31:30 +00:00
Richard Biener dd3f45609c re PR middle-end/79732 (ICE in set_ssa_default_def, at tree-dfa.c:327)
2017-02-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79732
	* tree-inline.c (expand_call_inline): Do not shadow var.

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

From-SVN: r245773
2017-02-28 12:38:57 +00:00
Richard Biener c7d97b2846 re PR tree-optimization/79723 (Another case of dropped gs: prefix)
2017-02-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79723
	* tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Preserve
	address-space properly.

	* gcc.target/i386/pr79723.c: New testcase.

From-SVN: r245772
2017-02-28 09:17:20 +00:00
Pat Haugen c8f28a3c7a re PR target/79544 (vec_sra (unsigned long long,foo) generating vsrd instead of vsrad)
PR target/79544
	* config/rs6000/rs6000-c.c (struct altivec_builtin_types): Use VSRAD
	for arithmetic shift of unsigned V2DI.
	* gcc.target/powerpc/pr79544.c: New.

From-SVN: r245762
2017-02-27 16:06:13 +00:00
Paolo Carlini c91c3003b5 re PR c++/79414 (internal compiler error after "error: expected unqualified-id at end of input")
2017-02-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/79414
	* g++.dg/parse/crash67.C: New.

From-SVN: r245756
2017-02-27 11:55:19 +00:00
Bin Cheng 57fa080bf6 re PR tree-optimization/77536 (Vectorizer not maintaining relationship of relative block frequencies in absence of real profile data)
PR tree-optimization/77536
	* tree-ssa-loop-manip.c (niter_for_unrolled_loop): New function.
	(tree_transform_and_unroll_loop): Use above function to compute the
	estimated niter of unrolled loop and use it when scaling profile.
	Also use count info rather than frequency if it's non-zero.
	* tree-ssa-loop-manip.h niter_for_unrolled_loop(): New declaration.
	* tree-vect-loop.c (scale_profile_for_vect_loop): New function.
	(vect_transform_loop): Call above function.

	gcc/testsuite
	* gcc.dg/vect/pr79347.c: Revise testing string.

From-SVN: r245754
2017-02-27 10:20:36 +00:00
Richard Biener 68b948d3ba re PR tree-optimization/45397 (Issues with integer narrowing conversions)
2017-02-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/45397
	* tree-ssa-pre.c (eliminate_insert): Handle BIT_AND_EXPR.
	* tree-ssa-sccvn.c (valueized_wider_op): New helper.
	(visit_nary_op): Add pattern matching for CSEing sign-changed
	or truncated operations with wider ones.

	* gcc.dg/tree-ssa/pr45397.c: New testcase.

From-SVN: r245752
2017-02-27 08:51:28 +00:00
Richard Biener 69a2e8a10b re PR tree-optimization/79690 (IVOPTs drops gs: prefix)
2017-02-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79690
	* tree-vect-stmts.c (vectorizable_store): Use vector type
	built from the DR with address-space.

	* gcc.target/i386/pr79690.c: New testcase.

From-SVN: r245751
2017-02-27 08:50:09 +00:00
Thomas Koenig c7b608a9f7 re PR libfortran/51119 (MATMUL slow for large matrices)
2017-02-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/51119
	* options.c (gfc_post_options): Set default limit for matmul
	inlining to 30.
	* invoke.texi: Document change.

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

	PR fortran/51119
	* gfortran.dg/inline_matmul_1.f90: Scan optimized dump instead
	of original.
	* gfortran.dg/inline_matmul_11.f90: Likewise.
	* gfortran.dg/inline_matmul_9.f90: Likewise.
	* gfortran.dg/matmul_13.f90: New test.
	* gfortran.dg/matmul_14.f90: New test.

From-SVN: r245745
2017-02-26 13:22:43 +00:00
Jakub Jelinek 98561a9b58 re PR middle-end/79396 (ICE (verify_flow_info failed) with -fnon-call-exceptions -O2 -march=haswell)
PR middle-end/79396
	* tree-eh.c (operation_could_trap_p, stmt_could_throw_1_p): Handle
	FMA_EXPR like tcc_binary or tcc_unary.

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

From-SVN: r245735
2017-02-25 11:17:31 +01:00
Dominique d'Humieres 77be94177a re PR fortran/79597 (Incomplete error message "Expecting %<END INTERFACE OPERATOR")
2017-02-25  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/79597
	* interface.c (gfc_match_end_interface): Remove spurious comma
	and space, replace 'got %s' with 'got %qs'.

2017-02-25  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/79597
	* gfortran.dg/dtio_6.f90: Update test.

2017-02-25  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/79601
	* interface.c (check_dtio_arg_TKR_intent): Change 'intent'
	to 'INTENT'.

2017-02-25  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/79601
	* gfortran.dg/interface_operator_2.f90: New test.

From-SVN: r245729
2017-02-25 00:40:42 +01:00
Jakub Jelinek b982244362 re PR c/79677 (Weird handling of -Werror=)
PR c/79677
	* opts.h (handle_generated_option): Add GENERATED_P argument.
	* opts-common.c (handle_option): Adjust function comment.
	(handle_generated_option): Add GENERATED_P argument, pass it to
	handle_option.
	(control_warning_option): Pass false to handle_generated_option
	GENERATED_P.
	* opts.c (maybe_default_option): Pass true to handle_generated_option
	GENERATED_P.
	* optc-gen.awk: Likewise.
ada/
	* gcc-interface/misc.c (gnat_handle_option): Pass true to
	handle_generated_option GENERATED_P.
testsuite/
	* gcc.dg/pr79677.c: New test.

From-SVN: r245728
2017-02-25 00:15:56 +01:00
Matthew Fortune 4bc2b7860f Update paired single tests to cope with ABI fixes for o32/o64
gcc/testsuite/

	* gcc.target/mips/mips-ps-type-2.c (move): Force generation
	of mov.ps.
	* gcc.target/mips/mips-ps-type.c (move): Likewise.
	(cond_move1): Simplify condition to force generation of
	mov[nz].ps.
	(cond_move2): Likewise.

From-SVN: r245722
2017-02-24 22:34:25 +00:00
Jakub Jelinek 4227c9adf0 re PR c++/79588 (ICE in warn_for_restrict with -Wrestrict)
PR c++/79588
c-family/
	* c-common.c (check_function_restrict): New function.
	(check_function_arguments): Add FNDECL argument.  Call
	check_function_restrict if -Wrestrict.
	* c-warn.c (warn_for_restrict): Remove ARGS argument, add ARGARRAY
	and NARGS.  Use auto_vec for ARG_POSITIONS, simplify.
	* c-common.h (check_function_arguments): Add FNDECL argument.
	(warn_for_restrict): Remove ARGS argument, add ARGARRAY and NARGS.
c/
	* c-parser.c (c_parser_postfix_expression_after_primary): Don't
	handle -Wrestrict here.
	* c-typeck.c (build_function_call_vec): Adjust
	check_function_arguments caller.
cp/
	* call.c (build_over_call): Call check_function_arguments even for
	-Wrestrict, adjust check_function_arguments caller.
	* parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
	here.
	* typeck.c (cp_build_function_call_vec): Adjust
	check_function_arguments caller.
testsuite/
	* g++.dg/warn/Wrestrict-1.C: New test.
	* g++.dg/warn/Wrestrict-2.C: New test.

From-SVN: r245719
2017-02-24 21:41:54 +01:00
David Edelsohn fd527ec190 Require LTO.
Add initial ChangeLog entry.

From-SVN: r245716
2017-02-24 13:39:44 -05:00
Toma Tabacu 2af8fd5cdf Use logical_op_short_circuit to skip targets in ssa-thread-14.c.
gcc/testsuite/

	* gcc.dg/tree-ssa/ssa-thread-14.c (dg-options): Use
	logical_op_short_circuit to skip targets.
	(dg-additional-options): Don't pass -mbranch-cost=2 for MIPS, AVR
	and s390.

From-SVN: r245711
2017-02-24 11:03:12 +00:00
Eric Botcazou 0b9cdb9a40 * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
From-SVN: r245701
2017-02-24 10:35:14 +00:00
Eric Botcazou 4af362a957 utils.c (max_size): Flip the second argument when recursing on TRUTH_NOT_EXPR.
* gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
	argument when recursing on TRUTH_NOT_EXPR.

From-SVN: r245697
2017-02-24 09:52:31 +00:00
Richard Biener 7699e88f68 re PR tree-optimization/79389 (30% performance regression in SciMark2 MonteCarlo)
2017-02-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79389
	* gimple-ssa-split-paths.c (is_feasible_trace): Verify more
	properly that a threading opportunity exists.  Detect conditional
	copy/constant propagation opportunities.

	* gcc.dg/tree-ssa/split-path-10.c: New testcase.

From-SVN: r245696
2017-02-24 08:04:31 +00:00
Paolo Carlini e3beb191c5 re PR c++/79361 (ICE redefining a template function as defaulted or deleted)
/cp
2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/79361
	* pt.c (register_specialization): Check duplicate_decls return value
	for error_mark_node and pass it back.

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

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

From-SVN: r245692
2017-02-23 23:20:58 +00:00
Eric Botcazou 195610aaa0 visium.md (type): Add trap.
* config/visium/visium.md (type): Add trap.
	(b): New mode attribute.
	(*btst): Rename into...
	(*btst<mode>): ...this and adjust.
	(*cbranchsi4_btst_insn): Rename into...
	(*cbranch<mode>4_btst_insn): ...this and adjust.
	(trap): New define_insn.

From-SVN: r245691
2017-02-23 23:04:00 +00:00
Dominik Vogt 17885cad6a PR 68749: S/390: Disable ifcvt-4.c for -m31.
gcc/testsuite/ChangeLog:

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

	PR 68749
	* gcc.dg/ifcvt-4.c: Disable for -m31, use -march=z196.

From-SVN: r245684
2017-02-23 15:18:16 +00:00
Richard Biener 45f7faf0b5 re PR tree-optimization/79683 (SLP vectorizer drops gs: prefix)
2017-02-23  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79683
	* tree-vect-stmts.c (vect_analyze_stmt): Do not overwrite
	vector types for data-refs.

	* gcc.target/i386/pr79683.c: New testcase.

From-SVN: r245679
2017-02-23 11:43:51 +00:00
Jeff Law 18eb304e5f re PR tree-optimization/79578 (Unnecessary instructions in generated code)
PR tree-optimization/79578
	* tree-ssa-dse.c (clear_bytes_written_by): Use operand_equal_p
	to compare base operands.

	PR tree-optimization/79578
	* g++.dg/tree-ssa/ssa-dse-3.C: New test.

From-SVN: r245675
2017-02-22 22:47:43 -07:00
Sameera Deshpande 0a864a97e9 Fix MIPS o32 calling convention for MSA and FP vector types
gcc/
	* config/mips/mips.c (mips_return_in_memory): Force FP
	vector types to be returned in memory for o32 ABI.

gcc/testsuite/

	* gcc.target/mips/msa-fp-cc.c: New test.

From-SVN: r245666
2017-02-22 23:09:43 +00:00
Jakub Jelinek e40b6fc7a1 re PR c++/79664 (ICE with #pragma omp parallel in constexpr function)
PR c++/79664
	* parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
	SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
	* constexpr.c (potential_constant_expression_1): Handle
	OMP_*, OACC_* and CILK_* trees.  Use error_at with
	EXPR_LOC_OR_LOC (t, input_location) computed early
	instead of error, or error_at with location_of (t).

	* g++.dg/gomp/teams-1.C: Adjust expected diagnostic location.
	* g++.dg/cpp1y/constexpr-throw.C: Likewise.
	* g++.dg/gomp/pr79664.C: New test.

From-SVN: r245662
2017-02-22 23:36:20 +01:00
Jakub Jelinek fe8ece053b dwarf2out.c (gen_variable_die): For -gdwarf-5...
* dwarf2out.c (gen_variable_die): For -gdwarf-5, use DW_TAG_variable
	instead of DW_TAG_member for static data member declarations and don't
	set no_linkage_name for static inline data members.
	(gen_member_die): For -gdwarf-5 don't change DW_TAG_variable
	to DW_TAG_member.

	* g++.dg/debug/dwarf2/inline-var-2.C: New test.

From-SVN: r245661
2017-02-22 22:33:47 +01:00
Marek Polacek 61ac5ebe61 re PR c/79662 (ICE on invalid code in convert_arguments in c/c-typeck.c:3452)
PR c/79662
	* c-typeck.c (convert_arguments): Handle error_mark_node.

	* gcc.dg/enum-incomplete-4.c: New test.

From-SVN: r245660
2017-02-22 21:28:42 +00:00
Marek Polacek 8fdddd3d83 re PR c++/79657 (ICE on invalid c++ code in finish_underlying_type cp/semantics.c:3849)
PR c++/79657
	* semantics.c (finish_underlying_type): Bail out for incomplete enums.

	* g++.dg/ext/underlying_type12.C: New test.

From-SVN: r245658
2017-02-22 19:33:13 +00:00
Marek Polacek 78af14ae0e re PR c++/79653 (ICE on invalid c++ code in cp_check_const_attributes in cp/decl2.c:1423)
PR c++/79653
	* parser.c (cp_parser_std_attribute_spec): Don't build the attribute
	if the alignas expression is erroneous.
	* pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
	error_mark_node.

	* g++.dg/cpp0x/alignas10.C: New test.
	* g++.dg/cpp0x/alignas9.C: New test.

From-SVN: r245657
2017-02-22 19:31:49 +00:00
Jakub Jelinek 888c705092 re PR target/70465 (Poor code for x87 asm)
PR target/70465
	* reg-stack.c (emit_swap_insn): Treat (float_extend:?F (mem:?F))
	and (const_double:?F) like (mem:?F) for the purpose of fxch %st(1)
	elimination by swapping fld*.

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

From-SVN: r245654
2017-02-22 18:17:17 +01:00
Uros Bizjak 6d3daa1afb pr61441.c: Use dg-add-options ieee.
* gcc.dg/pr61441.c: Use dg-add-options ieee.

From-SVN: r245652
2017-02-22 16:39:03 +01:00
Uros Bizjak b86fec684a ChangeLog: Add missing entry.
* ChangeLog: Add missing entry.
	* testsuite/ChangeLog: Ditto.

From-SVN: r245651
2017-02-22 16:36:24 +01:00
Richard Biener 76dd203e1b re PR middle-end/79673 (GIMPLE verification fails when compiling code with __seg_gs)
2017-02-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79673
	* tree-ssa-pre.c (compute_avail): Use wide_int_to_tree to
	convert the [TARGET_]MEM_REF offset INTEGER_CST, scrapping off
	irrelevant address-space qualifiers and avoiding a
	ADDR_SPACE_CONVERT_EXPR from fold_convert.

	* gcc.target/i386/pr79673.c: New testcase.

From-SVN: r245649
2017-02-22 15:00:39 +00:00
Richard Biener a9c774d2ae re PR tree-optimization/79666 (wrong code (SIGFPE) at -O2 on x86_64-linux-gnu (in both 32-bit and 64-bit modes))
2017-02-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79666
	* tree-vrp.c (extract_range_from_binary_expr_1): Make sure
	to not symbolically negate if that may introduce undefined
	overflow.

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

From-SVN: r245648
2017-02-22 12:11:27 +00:00
Martin Liska 8f4f841a3e Remove wrong assert about gcov_type (PR lto/79587).
2017-02-22  Martin Liska  <mliska@suse.cz>

	PR lto/79587
	* data-streamer-in.c (streamer_read_gcov_count): Remove assert.
	* data-streamer-out.c (streamer_write_gcov_count_stream):
	Likewise.
	* value-prof.c (stream_out_histogram_value): Make assert more
	precise based on type of counter.
2017-02-22  Martin Liska  <mliska@suse.cz>

	PR lto/79587
	* gcc.dg/tree-prof/pr79587.c: New test.

From-SVN: r245647
2017-02-22 09:45:42 +00:00
Marek Polacek a232a1cb17 re PR c++/79535 (ICE in verify_ctor_sanity, at cp/constexpr.c:2636)
PR c++/79535
	* cp-tree.h (maybe_reject_flexarray_init): Declare.
	* init.c (maybe_reject_flexarray_init): No longer static.
	Add check for current_function_decl.
	* parser.c (cp_parser_late_parse_one_default_arg): Reject
	a default mem-initializer for a flexible array.

	* g++.dg/ext/flexary23.C: New test.

From-SVN: r245641
2017-02-21 20:23:09 +00:00
Jakub Jelinek b7280ac270 re PR c++/79654 (ICE on invalid c++ code in register_dtor_fn in cp/decl.c:7877)
PR c++/79654
	* decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
	on error.
	* pt.c (tsubst_decomp_names): Return error_mark_node if the first
	decl after the decomposition artificial decl has error_mark_node.
	* decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
	instead of just == error_mark_node comparison.

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

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

From-SVN: r245639
2017-02-21 19:00:35 +01:00
Jakub Jelinek 5c3f1d7b10 re PR sanitizer/79589 (ICE in gimplify_compound_expr (gimplify.c:5712) with -fsanitize=undefined)
PR sanitizer/79589
	* decl.c: Include gimplify.h.
	(cp_finish_decomp): Make sure there is no sharing of trees
	in between DECL_VALUE_EXPR of decomposition decls.

	* g++.dg/ubsan/pr79589.C: New test.

From-SVN: r245638
2017-02-21 18:59:07 +01:00
Jeff Law 1486c2a780 re PR tree-optimization/79621 (Missed path isolation opportunity)
PR tree-optimization/79621
	* gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior): Ignore
	blocks with edges to themselves.

	PR tree-optimization/79621
	* gcc.c-torture/compile/pr79621.c: New test.

From-SVN: r245637
2017-02-21 10:58:00 -07:00
Jakub Jelinek 3bb4311904 re PR c++/79655 (ICE on invalid c++ code in cxx_eval_store_expression in cp/constexpr.c:3464)
PR c++/79655
	* constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.

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

From-SVN: r245636
2017-02-21 18:57:23 +01:00
Jakub Jelinek 664beaf2c1 re PR c++/79639 (ICE with -O and constexpr)
PR c++/79639
	* constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
	call cplus_expand_constant on it first.

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

From-SVN: r245635
2017-02-21 18:48:57 +01:00