Commit Graph

147301 Commits

Author SHA1 Message Date
Richard Biener cef5388d95 re PR tree-optimization/71901 (ice in find_or_generate_expression)
2016-07-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71901
	* tree-ssa-sccvn.h (struct vn_reference_op_struct): Add
	align member, group stuff with the bitfield.
	(vn_ref_op_align_unit): New inline.
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): For ARRAY_REFs
	record element alignment and operand 3 unchanged.
	(ao_ref_init_from_vn_reference): Adjust.
	(valueize_refs_1): Likewise.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise.

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

From-SVN: r238468
2016-07-19 10:19:46 +00:00
Richard Biener 9a4cb9733d re PR tree-optimization/71908 (ICE at -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (get_constraint_for_component_ref))
2016-07-18  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71908
	* tree-ssa-structalias.c (get_constraint_for_component_ref): Handle
	symbolic constants in a more reliable way.

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

From-SVN: r238467
2016-07-19 10:18:25 +00:00
Ilya Enkovich d9157f1514 tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Update comment.
gcc/

	* tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Update
	comment.
	(vect_update_inits_of_drs): Likewise.
	(vect_create_cond_for_alias_checks): Likewise.
	* tree-vect-loop.c (vect_get_known_peeling_cost): Likewise.

From-SVN: r238466
2016-07-19 10:04:02 +00:00
Richard Biener f6918a8b63 re PR middle-end/71907 (missing buffer overflow warnings with -flto)
2016-07-19  Richard Biener  <rguenther@suse.de>

	PR lto/71907
	* lto-streamer-out.c (DFS::DFS_write_tree_body): For blocks
	with an abstract origin that is not an inlined function outer
	scope add a self-reference as abstract origin.
	* tree-streamer-out.c (write_ts_block_tree_pointers): Likewise.

From-SVN: r238456
2016-07-19 07:35:05 +00:00
Michael Meissner a8f7a89526 re PR target/71493 (accidental ABI change for structure return on PowerPC)
[gcc]
2016-07-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/71493
	* config/rs6000/rs6000.c (rs6000_function_value): Fix
	unintentional System V.4 structure return breakage for structures
	with a single floating point element.

[gcc/testsuite]
2016-07-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/71493
	* gcc.target/powerpc/pr71493-1.c: New test.
	* gcc.target/powerpc/pr71493-2.c: Likewise.

From-SVN: r238454
2016-07-19 03:31:48 +00:00
GCC Administrator 40d9a67476 Daily bump.
From-SVN: r238453
2016-07-19 00:16:18 +00:00
Jakub Jelinek e43ebb1268 re PR c++/70869 (internal compiler error: Segmentation fault on array of pointer to function members)
PR c++/70869
	PR c++/71054
	* cp-gimplify.c (cp_genericize_r): Revert the 2016-07-07 change.
	* tree.c (cp_walk_subtrees): For DECL_EXPR on DECL_ARTIFICIAL
	non-static VAR_DECL, walk the decl's DECL_INITIAL, DECL_SIZE and
	DECL_SIZE_UNIT.

From-SVN: r238444
2016-07-18 20:45:18 +02:00
Jakub Jelinek 99516432c2 re PR c++/71835 (ICE on invalid C++ code with ambiguous overloaded operators: tree check: expected tree that contains ‘decl minimal’ structure, have ‘pointer_type’ in convert_like_real, at cp/call.c:6549)
PR c++/71835
	* call.c (build_op_call_1): Use convert_like_with_context only
	if cand->fn is a decl.

	* g++.dg/conversion/ambig3.C: New test.

From-SVN: r238443
2016-07-18 20:44:51 +02:00
Jakub Jelinek 87713c6a50 re PR c++/71828 (ICE on valid C++11 code with constexpr __Complex int variable declaration: in operand_equal_p, at fold-const.c:2790)
PR c++/71828
	* constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>:
	For lval don't use cxx_eval_unary_expression and instead recurse
	and if needed rebuild the reference.

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

From-SVN: r238442
2016-07-18 20:43:19 +02:00
Jakub Jelinek 7a7f16ca45 re PR c++/71826 (ICE on valid C++ code with ambiguous member lookup: tree check: expected baselink, have error_mark in tsubst_baselink, at cp/pt.c:13737)
PR c++/71826
	* pt.c (tsubst_baselink): Only set BASELINK_OPTYPE for BASELINK_P.

	* g++.dg/template/pr71826.C: New test.

From-SVN: r238441
2016-07-18 20:42:24 +02:00
Jakub Jelinek f4d902955b re PR c++/71822 (ICE: in gimplify_expr, at gimplify.c:11025)
PR c++/71822
	* cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
	fold *expr_p before genericizing it.

	* g++.dg/template/defarg21.C: New test.

From-SVN: r238440
2016-07-18 20:40:12 +02:00
Jakub Jelinek f2111a3640 re PR c++/71871 (ICE on mixing templates and vector extensions ternary operator)
PR c++/71871
	* typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.

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

From-SVN: r238439
2016-07-18 19:44:48 +02:00
Uros Bizjak 0b96552628 pr70017.c: Do not check for warning on alpha*-*-*.
* gcc.dg/pr70017.c: Do not check for warning on alpha*-*-*.

From-SVN: r238438
2016-07-18 17:55:36 +02:00
Jason Merrill 7864eaaff7 Demangle C++17 fold-expressions.
* cp-demangle.c (cplus_demangle_operators): Add f[lrLR].
	(d_expression_1): Handle them.
	(d_maybe_print_fold_expression): New.
	(d_print_comp_inner): Use it.
	(d_index_template_argument): Handle negative index.

From-SVN: r238437
2016-07-18 11:28:51 -04:00
Ville Voutilainen 40f3e91334 Clean up optional's comments.
From-SVN: r238436
2016-07-18 17:45:56 +03:00
Yuri Rumyantsev 94e136b95b re PR middle-end/71734 (FAIL: libgomp.fortran/simd4.f90 -O3 -g execution test)
gcc/

2016-07-18  Yuri Rumyantsev  <ysrumyan@gmail.com>

	PR tree-optimization/71734
	* tree-ssa-loop-im.c (ref_indep_loop_p_1): Add REF_LOOP argument which
	contains REF, use it to check safelen, assume that safelen value
	must be greater 1, fix style.
	(ref_indep_loop_p_2): Add REF_LOOP argument.
	(ref_indep_loop_p): Pass LOOP as additional argument to
	ref_indep_loop_p_2.

gcc/testsuite/

2016-07-18  Yuri Rumyantsev  <ysrumyan@gmail.com>

	PR tree-optimization/71734
	* g++.dg/vect/pr70729.cc: Delete redundant dg options, fix style.

From-SVN: r238435
2016-07-18 14:30:20 +00:00
Dominik Vogt 7072df0aae Allocate constant size dynamic stack space in the prologue
The attached patch fixes a warning during Linux kernel compilation
on S/390 due to -mwarn-dynamicstack and runtime alignment of stack
variables with constant size causing cfun->calls_alloca to be set
(even if alloca is not used at all).  The patched code places
constant size runtime aligned variables in the "virtual stack
vars" area instead of creating a "virtual stack dynamic" area.

This behaviour is activated by defining

  #define ALLOCATE_DYNAMIC_STACK_SPACE_IN_PROLOGUE 1

in the backend; otherwise the old logic is used.

The kernel uses runtime alignment for the page structure (aligned
to 16 bytes), and apart from triggereing the alloca warning
(-mwarn-dynamicstack), the current Gcc also generates inefficient
code like

  aghi %r15,-160  # prologue: create stack frame
    lgr %r11,%r15   # prologue: generate frame pointer
      aghi %r15,-32   # space for dynamic stack

which could be simplified to

  aghi %r15,-192

(if later optimization passes are able to get rid of the frame
pointer).  Is there a specific reason why the patched behaviour
shouldn't be used for all platforms?

--

As the placement of runtime aligned stack variables with constant
size is done completely in the middleend, I don't see a way to fix
this in the backend.

gcc/ChangeLog:

2016-07-18  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* cfgexpand.c (expand_stack_vars): Implement synamic stack space
	allocation in the prologue.
	* explow.c (get_dynamic_stack_base): New function to return an address
	expression for the dynamic stack base.
	(get_dynamic_stack_size): New function to do the required dynamic stack
	space size calculations.
	(allocate_dynamic_stack_space): Use new functions.
	(align_dynamic_address): Move some code from
	allocate_dynamic_stack_space to new function.
	* explow.h (get_dynamic_stack_base, get_dynamic_stack_size): Export.

gcc/testsuite/ChangeLog:

2016-07-18  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* gcc.target/s390/warn-dynamicstack-1.c: New test.
	* gcc.dg/stack-usage-2.c (foo3): Adapt expected warning.
	stack-layout-dynamic-1.c: New test.

From-SVN: r238432
2016-07-18 13:10:27 +00:00
Andreas Krebbel 54158a1aa9 S/390: Fix alignment check for literal pool references.
gcc/ChangeLog:

2016-07-18  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.c (s390_encode_section_info): Always set
	notaligned marker if mode size is 0 or no MEM_ALIGN info could be
	found.

gcc/testsuite/ChangeLog:

2016-07-18  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/nolrl-1.c: New test.

From-SVN: r238427
2016-07-18 10:47:09 +00:00
Richard Biener 2e7565b268 re PR tree-optimization/71893 (gfortran.dg ICEs in gcc/tree-ssa-pre.c; -fcode-hoisting?)
2016-07-18  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71893
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Compensate
	for sizetype cast added by array_ref_element_size.
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.

From-SVN: r238426
2016-07-18 08:46:42 +00:00
GCC Administrator 9c9549e100 Daily bump.
From-SVN: r238424
2016-07-18 00:16:21 +00:00
Fritz Reese 43068916e3 re PR fortran/71523 (Static variables given automatic initializers with -finit-* and -fmax-stack-var-size)
2016-07-17  Fritz Reese  <fritzoreese@gmail.com>

	PR fortran/71523
	* trans-decl.c (gfc_finish_var_decl): Replace automatic initializer with
	a static one.

	* gfortran.dg/pr71523_1.f90: New test.
	* gfortran.dg/pr71523_2.f90: New test.

From-SVN: r238420
2016-07-17 20:13:41 +00:00
GCC Administrator 48b3613757 Daily bump.
From-SVN: r238419
2016-07-17 00:16:19 +00:00
John David Anglin 730a27a251 pa.c (hppa_profile_hook): Allocate stack space for register parameters.
* config/pa/pa.c (hppa_profile_hook): Allocate stack space for
	register parameters.  Remove code to initialize argument pointer
	on TARGET_64BIT.  Optimize call to _mcount when it can be reached
	using a pc-relative branch.  Cleanup conditional code.
	* config/pa/pa.md (call_mcount): New expander.
	(call_mcount_nonpic): New insn.
	(call_mcount_pic): New insn and split.
	(call_mcount_pic_post_reload): New insn.
	(call_mcount_64bit): New insn and split.
	(call_mcount_64bit_post_reload): New insn.

From-SVN: r238414
2016-07-16 15:59:33 +00:00
Andreas Schwab a9356b1242 nullptr35.C (caught): Fix typo.
* g++.dg/cpp0x/nullptr35.C (caught): Fix typo.

From-SVN: r238413
2016-07-16 09:53:23 +00:00
GCC Administrator 5a12c91315 Daily bump.
From-SVN: r238409
2016-07-16 00:16:22 +00:00
Jonathan Wakely 4f5f9962c8 Replace references to C++0x with C++11 in comments
* include/bits/algorithmfwd.h: Change C++0x to C++11 in comments.
	* include/bits/move.h: Likewise.
	* include/bits/postypes.h: Likewise.
	* include/debug/bitset: Likewise.
	* include/ext/pb_ds/detail/type_utils.hpp: Likewise.
	* include/ext/string_conversions.h: Change C++0x to __cxx11 in
	comment.
	* testsuite/27_io/fpos/14320-1.cc: Change C++0x to C++11 in comment.
	* testsuite/util/thread/all.h: Likewise.

From-SVN: r238402
2016-07-15 21:23:08 +01:00
Jerry DeLisle a07b81c742 re PR fortran/62125 (Nested select type not accepted (rejects valid))
2016-07-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Marco Restelli <mrestelli@gmail.com>

	PR fortran/62125
	* symbol.c (select_type_insert_tmp): Recursively call self to take care
	of nested select type.

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

Co-Authored-By: Marco Restelli <mrestelli@gmail.com>

From-SVN: r238400
2016-07-15 19:58:55 +00:00
Jonathan Wakely d1129d45b0 Remove redundant std::move in std::for_each
* include/bits/stl_algo.h (for_each): Remove redundant _GLIBCXX_MOVE
	and adjust comment.

From-SVN: r238399
2016-07-15 20:51:33 +01:00
Bill Schmidt 96c0ec125f divkc3-1.c: Require p8vector support.
2016-07-15  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/divkc3-1.c: Require p8vector support.
	* gcc.target/powerpc/mulkc3-1.c: Likewise.

From-SVN: r238398
2016-07-15 18:57:06 +00:00
Jason Merrill 37a80bf956 PR c++/71495 - spurious note during SFINAE.
* call.c (convert_like_real): Mask complain.
	* semantics.c (perform_koenig_lookup): Likewise.

From-SVN: r238397
2016-07-15 14:56:29 -04:00
Jonathan Wakely 479d0ed590 c++/58796 Make nullptr match exception handlers of pointer type
libstdc++-v3:

	PR c++/58796
	* libsupc++/pbase_type_info.cc (__pbase_type_info::__do_catch): Make
	nullptr match handlers of pointer type.

gcc/testsuite:

	PR c++/58796
	* g++.dg/cpp0x/nullptr21.C: Remove void* handlers.
	* g++.dg/cpp0x/nullptr35.C: New test.

From-SVN: r238396
2016-07-15 19:51:51 +01:00
Jason Merrill de54de93fa PR c++/71092 - ICE with array and constexpr.
* constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
	threw away DECL_SAVED_TREE.

From-SVN: r238395
2016-07-15 14:49:38 -04:00
Jason Merrill 4d031550cc PR c++/71117 - core 2189 and generic lambda
* call.c (add_template_conv_candidate): Disable if there are
	viable candidates.

From-SVN: r238394
2016-07-15 14:49:25 -04:00
Jason Merrill 2a54351ba7 PR c++/71511 - ICE on decltype scope in declaration.
* typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.

From-SVN: r238393
2016-07-15 14:38:48 -04:00
Jason Merrill 1019d19180 PR c++/71513 - alignas on member enum in template
* pt.c (tsubst_attributes): Fix loop logic.

From-SVN: r238392
2016-07-15 14:38:40 -04:00
Jason Merrill 37a92c0ca2 PR c++/71604 - type definition in range-based for
PR c++/54430
	* parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
	(cp_parser_simple_declaration): Diagnose type definition in
	for-range-declaration.

From-SVN: r238391
2016-07-15 14:38:31 -04:00
Jason Merrill aa30dfadf3 PR c++/71711 - mangle C++1z fold-expressions.
* operators.def: Add *_FOLD_EXPR.
	* cp-tree.h (FOLD_EXPR_P): Parenthesize.
	* mangle.c (write_expression): Handle fold-expressions.
	* pt.c (tsubst_unary_left_fold, tsubst_binary_left_fold)
	(tsubst_unary_right_fold, tsubst_binary_right_fold): Handle
	partial instantiation.

From-SVN: r238390
2016-07-15 14:38:23 -04:00
Jason Merrill 34bbc4c502 PR c++/71814 - mangling sizeof... (sP and sZ)
gcc/cp/
	* mangle.c (write_expression): Handle sizeof... an argument pack.
libiberty/
	* cp-demangle.c (cplus_demangle_operators): Add sP and sZ.
	(d_print_comp_inner): Handle them.
	(d_template_args_1): Split out from d_template_args.
	(d_args_length): New.

From-SVN: r238389
2016-07-15 14:38:15 -04:00
Jason Merrill d022c55a4b Update -fabi-version default to 11.
* c-opts.c (c_common_post_options): Update -fabi-version default to 11.

From-SVN: r238388
2016-07-15 14:38:05 -04:00
Jason Merrill 9ee2cecc2f PR c++/71718 - infinite recursion and alias template
* pt.c (push_tinst_level_loc): Set at_eof before fatal_error.

From-SVN: r238387
2016-07-15 14:37:56 -04:00
Jason Merrill d1dfa20d80 PR c++/70824 - initializer_list in template
* init.c (constant_value_1): Don't instantiated DECL_INITIAL of
	artificial variables.

From-SVN: r238386
2016-07-15 14:37:48 -04:00
Edward Smith-Rowland 4db1cb44be Implement C++17 P0025 clamp.
2016-07-15  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement C++17 P0025 clamp.
	* include/bits/algorithmfwd.h: Declare clamp overloads.
	* include/bits/stl_algo.h: Implement clamp.  Feature __cpp_lib_clamp.
	* testsuite/25_algorithms/clamp/1.cc: New test.
	* testsuite/25_algorithms/clamp/2.cc: New test.
	* testsuite/25_algorithms/clamp/constexpr.cc: New test.
	* testsuite/25_algorithms/clamp/requirements/explicit_instantiation/
	1.cc: New test.
	* testsuite/25_algorithms/clamp/requirements/explicit_instantiation/
	pod.cc: New test.

From-SVN: r238383
2016-07-15 17:16:32 +00:00
Georg-Johann Lay 4a1248da39 Typo.
From-SVN: r238382
2016-07-15 16:28:17 +00:00
Georg-Johann Lay be88b0c781 predicates.md (const_m255_to_m1_operand): New.
* config/avr/predicates.md (const_m255_to_m1_operand): New.
	* config/avr/constraints.md (Cn8, Ca1, Co1, Yx2): New constraints.
	* config/avr/avr.md (add<mode>3) <ALL1>: Make "r,0,r" more
	expensive.
	(*cmphi.zero-extend.0, *cmphi.zero-extend.1)
	(*usum_widenqihi3, *udiff_widenqihi3)
	(*addhi3_zero_extend.const): New combiner insns.
	(andqi3, iorqi3): Provide "l" (NO_LD_REGS) alternative if
	just 1 bit is affected.
	* config/avr/avr.c (avr_out_bitop) <QImode>: Don't access xop[3].
	(avr_out_compare) [EQ,NE]: Tweak comparing d-regs against -1.

From-SVN: r238381
2016-07-15 16:25:38 +00:00
Jakub Jelinek 5eed9a887b Fix up ChangeLog entry.
From-SVN: r238378
2016-07-15 17:28:26 +02:00
Bin Cheng 41c7438e90 scev-8.c: Update test string.
gcc/testsuite
	* gcc.dg/tree-ssa/scev-8.c: Update test string.

From-SVN: r238377
2016-07-15 14:21:55 +00:00
Cesar Philippidis b1c9c068f7 c-parser.c (c_parser_oacc_declare): Don't scan for GOMP_MAP_POINTER.
gcc/c/
	* c-parser.c (c_parser_oacc_declare): Don't scan for
	GOMP_MAP_POINTER.
	* c-typeck.c (handle_omp_array_sections): Mark data clauses with
	GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
	zero-length subarrays.

	gcc/cp/
	* parser.c (cp_parser_oacc_declare): Don't scan for
	GOMP_MAP_POINTER.
	* semantics.c (handle_omp_array_sections): Mark data clauses with
	GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
	zero-length subarrays.

	gcc/
	* omp-low.c (lower_omp_target): Mark data clauses with
	GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
	zero-length subarrays.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/zero_length_subarrays.c: New
	test.

From-SVN: r238376
2016-07-15 07:13:48 -07:00
Cesar Philippidis f7ba880b6b openmp.c (gfc_match_omp_clauses): Scan for clause vector_length before vector.
gcc/fortran/
	* openmp.c (gfc_match_omp_clauses): Scan for clause vector_length
	before vector.

	gcc/testsuite/
	* gfortran.dg/goacc/vector_length.f90: New test.

From-SVN: r238375
2016-07-15 07:03:35 -07:00
Richard Biener b9aba0a058 re PR tree-optimization/71881 (ICE on valid code at -O3 with -g enabled on x86_64-linux-gnu: cannot update SSA form)
2016-07-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71881
	* tree-loop-distribution.c (destroy_loop): Remove blocks in
	reverse DOM order to make debug temp generation happy.

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

From-SVN: r238374
2016-07-15 13:05:56 +00:00
Richard Biener 9513d5fbca re PR tree-optimization/71887 (wrong code (SIGFPE) at -O1 and above on x86_64-linux-gnu (in both 32-bit and 64-bit modes))
2016-07-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71887
	* tree-ssa-phiopt.c (absorbing_element_p): Add rhs arg and
	verify it is not zero for division / modulo handling.
	(value_replacement): Adjust.

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

From-SVN: r238373
2016-07-15 12:56:17 +00:00