Commit Graph

29662 Commits

Author SHA1 Message Date
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