- 26 Apr, 2016 19 commits
-
-
2016-04-26 Marc Glisse <marc.glisse@inria.fr> gcc/ * match.pd (X + CST CMP X): New transformation. gcc/testsuite/ * gcc.dg/tree-ssa/overflow-1.c: New testcase. From-SVN: r235448
Marc Glisse committed -
PR c/70791 * c-decl.c (pushdecl): Pass LOCUS down to warning. * gcc.dg/Wnested-externs-2.c: New test. From-SVN: r235447
Marek Polacek committed -
PR c/67784 * c-parser.c (c_parser_maybe_reclassify_token): New function factored out of ... (c_parser_for_statement): ... here. (c_parser_if_statement): Use it. (c_parser_switch_statement): Use it. (c_parser_while_statement): Use it. * gcc.dg/pr67784-3.c: New test. * gcc.dg/pr67784-4.c: New test. * gcc.dg/pr67784-5.c: New test. From-SVN: r235446
Marek Polacek committed -
From-SVN: r235445
Jason Merrill committed -
2016-04-26 Marc Glisse <marc.glisse@inria.fr> gcc/ * genmatch.c (write_predicate): Add ATTRIBUTE_UNUSED. * fold-const.c (fold_binary_loc): Remove 2 transformations superseded by match.pd. * match.pd (x+x -> x*2): Generalize to integers. gcc/testsuite/ * gcc.dg/fold-plusmult.c: Adjust. * gcc.dg/no-strict-overflow-6.c: Adjust. * gcc.dg/gomp/loop-1.c: Xfail some tests. From-SVN: r235444
Marc Glisse committed -
* config/i386/i386.md (operation on memory peephole): Duplicate an existing peephole and adapt it to match lea rather than an operation that clobbers CC. From-SVN: r235443
Bernd Schmidt committed -
PR rtl-optimization/57193 * opts.c (default_options_table): Add OPT_frename_registers at -O2 and above. * doc/invoke.texi (-frename-registers, -O2): Update documentation. From-SVN: r235442
Bernd Schmidt committed -
* gcc.target/i386/avx512bw-vptestmb-1.c: Correct [xyz]mm register number scans. * gcc.target/i386/avx512bw-vptestmw-1.c: Likewise. * gcc.target/i386/avx512bw-vptestnmb-1.c: Likewise. * gcc.target/i386/avx512bw-vptestnmw-1.c: Likewise. * gcc.target/i386/avx512cd-vpbroadcastmb2q-1.c: Likewise. * gcc.target/i386/avx512cd-vpbroadcastmw2d-1.c: Likewise. * gcc.target/i386/avx512dq-vfpclasspd-1.c: Likewise. * gcc.target/i386/avx512dq-vfpclassps-1.c: Likewise. * gcc.target/i386/avx512dq-vinsertf64x2-1.c: Likewise. * gcc.target/i386/avx512dq-vinserti64x2-1.c: Likewise. * gcc.target/i386/avx512f-gather-5.c: Likewise. * gcc.target/i386/avx512f-vptestmd-1.c: Likewise. * gcc.target/i386/avx512f-vptestmq-1.c: Likewise. * gcc.target/i386/avx512f-vptestnmd-1.c: Likewise. * gcc.target/i386/avx512f-vptestnmq-1.c: Likewise. * gcc.target/i386/avx512f-vrndscaleps-1.c: Likewise. * gcc.target/i386/avx512vl-vpbroadcastmb2q-1.c: Likewise. * gcc.target/i386/avx512vl-vpbroadcastmw2d-1.c: Likewise. * gcc.target/i386/avx512vl-vptestmd-1.c: Likewise. * gcc.target/i386/avx512vl-vptestmq-1.c: Likewise. * gcc.target/i386/avx512vl-vptestnmd-1.c: Likewise. * gcc.target/i386/avx512vl-vptestnmq-1.c: Likewise. * gcc.target/i386/pr32219-2.c: Allow registers other than %eax in scans. * gcc.target/i386/pr32219-4.c: Likewise. * gcc.target/i386/pr32219-6.c: Likewise. * gcc.target/i386/pr32219-8.c: Likewise. From-SVN: r235441
Bernd Schmidt committed -
* gcc.dg/tree-ssa/minmax-2.c: Require c99_runtime and add the associated options. From-SVN: r235440
Kyrylo Tkachov committed -
2016-04-26 Martin Jambor <mjambor@suse.cz> * tree-cfg.c (verify_gimple_call): Check that calls to __builtin_unreachable or __builtin_trap do not have actual arguments. From-SVN: r235439
Martin Jambor committed -
2016-04-25 Marek Polacek <polacek@redhat.com> PR c++/70744 * call.c (build_conditional_expr_1): Call cp_stabilize_reference instead of stabilize_reference. (build_over_call): Likewise. * cp-tree.h (cp_stabilize_reference): Declare. * tree.c (cp_stabilize_reference): New function. * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of stabilize_reference. (unary_complex_lvalue): Likewise. (cp_build_modify_expr): Likewise. * g++.dg/ext/cond2.C: New test. diff --git gcc/cp/call.c gcc/cp/call.c index 11f2d42..476e806 100644 --- gcc/cp/call.c +++ gcc/cp/call.c @@ -4634,7 +4634,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3, /* Make sure that lvalues remain lvalues. See g++.oliva/ext1.C. */ if (real_lvalue_p (arg1)) - arg2 = arg1 = stabilize_reference (arg1); + arg2 = arg1 = cp_stabilize_reference (arg1); else arg2 = arg1 = save_expr (arg1); } @@ -7644,8 +7644,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) || (TREE_CODE (arg) == TARGET_EXPR && !unsafe_copy_elision_p (fa, arg))) { - tree to = stabilize_reference (cp_build_indirect_ref (fa, RO_NULL, - complain)); + tree to = cp_stabilize_reference (cp_build_indirect_ref (fa, + RO_NULL, + complain)); val = build2 (INIT_EXPR, DECL_CONTEXT (fn), to, arg); return val; @@ -7655,7 +7656,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) && trivial_fn_p (fn) && !DECL_DELETED_FN (fn)) { - tree to = stabilize_reference + tree to = cp_stabilize_reference (cp_build_indirect_ref (argarray[0], RO_NULL, complain)); tree type = TREE_TYPE (to); tree as_base = CLASSTYPE_AS_BASE (type); diff --git gcc/cp/cp-tree.h gcc/cp/cp-tree.h index ec92718..0e46ae1 100644 --- gcc/cp/cp-tree.h +++ gcc/cp/cp-tree.h @@ -6494,6 +6494,7 @@ extern cp_lvalue_kind real_lvalue_p (const_tree); extern cp_lvalue_kind lvalue_kind (const_tree); extern bool lvalue_or_rvalue_with_address_p (const_tree); extern bool xvalue_p (const_tree); +extern tree cp_stabilize_reference (tree); extern bool builtin_valid_in_constant_expr_p (const_tree); extern tree build_min (enum tree_code, tree, ...); extern tree build_min_nt_loc (location_t, enum tree_code, diff --git gcc/cp/tree.c gcc/cp/tree.c index 112c8c7..137186f 100644 --- gcc/cp/tree.c +++ gcc/cp/tree.c @@ -296,6 +296,46 @@ xvalue_p (const_tree ref) return (lvalue_kind (ref) == clk_rvalueref); } +/* C++-specific version of stabilize_reference. */ + +tree +cp_stabilize_reference (tree ref) +{ + switch (TREE_CODE (ref)) + { + /* We need to treat specially anything stabilize_reference doesn't + handle specifically. */ + case VAR_DECL: + case PARM_DECL: + case RESULT_DECL: + CASE_CONVERT: + case FLOAT_EXPR: + case FIX_TRUNC_EXPR: + case INDIRECT_REF: + case COMPONENT_REF: + case BIT_FIELD_REF: + case ARRAY_REF: + case ARRAY_RANGE_REF: + case COMPOUND_EXPR: + case ERROR_MARK: + break; + default: + cp_lvalue_kind kind = lvalue_kind (ref); + if ((kind & ~clk_class) != clk_none) + { + tree type = unlowered_expr_type (ref); + bool rval = !!(kind & clk_rvalueref); + type = cp_build_reference_type (type, rval); + /* This inhibits warnings in, eg, cxx_mark_addressable + (c++/60955). */ + warning_sentinel s (extra_warnings); + ref = build_static_cast (type, ref, tf_error); + } + } + + return stabilize_reference (ref); +} + /* Test whether DECL is a builtin that may appear in a constant-expression. */ diff --git gcc/cp/typeck.c gcc/cp/typeck.c index cef5604..7e12009 100644 --- gcc/cp/typeck.c +++ gcc/cp/typeck.c @@ -5912,7 +5912,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, { tree real, imag; - arg = stabilize_reference (arg); + arg = cp_stabilize_reference (arg); real = cp_build_unary_op (REALPART_EXPR, arg, 1, complain); imag = cp_build_unary_op (IMAGPART_EXPR, arg, 1, complain); real = cp_build_unary_op (code, real, 1, complain); @@ -6112,7 +6112,7 @@ unary_complex_lvalue (enum tree_code code, tree arg) tree lvalue = TREE_OPERAND (arg, 0); if (TREE_SIDE_EFFECTS (lvalue)) { - lvalue = stabilize_reference (lvalue); + lvalue = cp_stabilize_reference (lvalue); arg = build2 (TREE_CODE (arg), TREE_TYPE (arg), lvalue, TREE_OPERAND (arg, 1)); } @@ -7496,7 +7496,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, case PREINCREMENT_EXPR: if (TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0))) lhs = build2 (TREE_CODE (lhs), TREE_TYPE (lhs), - stabilize_reference (TREE_OPERAND (lhs, 0)), + cp_stabilize_reference (TREE_OPERAND (lhs, 0)), TREE_OPERAND (lhs, 1)); newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 0), modifycode, rhs, complain); @@ -7516,7 +7516,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, case MODIFY_EXPR: if (TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0))) lhs = build2 (TREE_CODE (lhs), TREE_TYPE (lhs), - stabilize_reference (TREE_OPERAND (lhs, 0)), + cp_stabilize_reference (TREE_OPERAND (lhs, 0)), TREE_OPERAND (lhs, 1)); newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 0), modifycode, rhs, complain); @@ -7665,7 +7665,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, not intervene between the lvalue-to-rvalue conversion and the side effect associated with any single compound assignment operator. -- end note ] */ - lhs = stabilize_reference (lhs); + lhs = cp_stabilize_reference (lhs); rhs = rvalue (rhs); rhs = stabilize_expr (rhs, &init); newrhs = cp_build_binary_op (input_location, diff --git gcc/testsuite/g++.dg/ext/cond2.C gcc/testsuite/g++.dg/ext/cond2.C index e69de29..d9f1d59 100644 --- gcc/testsuite/g++.dg/ext/cond2.C +++ gcc/testsuite/g++.dg/ext/cond2.C @@ -0,0 +1,28 @@ +// PR c++/70744 +// { dg-do run } +// { dg-options "" } + +static void +fn1 (void) +{ + int x = 2; + ++x ? : 42; + if (x != 3) + __builtin_abort (); + --x ? : 42; + if (x != 2) + __builtin_abort (); + x++ ? : 42; + if (x != 3) + __builtin_abort (); + x-- ? : 42; + if (x != 2) + __builtin_abort (); +} + +int +main () +{ + fn1 (); + return 0; +} From-SVN: r235438
Marek Polacek committed -
* tree-if-conv.c (any_pred_load_store): New static variable. (if_convertible_gimple_assign_stmt_p): Remove parameter. Use any_pred_load_store instead of and_mask_load_store. (if_convertible_stmt_p, if_convertible_loop_p_1): Ditto. (if_convertible_loop_p, insert_gimplified_predicates): Ditto. (combine_blocks, tree_if_conversion): Ditto. From-SVN: r235437
Bin Cheng committed -
re PR tree-optimization/70771 (ICE on valid code at -O3 on x86_64-linux-gnu in operator[], at vec.h:714) PR tree-optimization/70771 PR tree-optimization/70775 * tree-if-conv.c (if_convertible_phi_p): Remove check on special virtual PHI nodes. Delete parameter. (if_convertible_loop_p_1): Delete argument to above function. (predicate_all_scalar_phis): Delete code handling single-argument PHIs. (tree_if_conversion): Mark and update virtual SSA. gcc/testsuite/ChangeLog PR tree-optimization/70771 PR tree-optimization/70775 * gcc.dg/pr70771.c: New test. * gcc.dg/pr70771.c: New test. From-SVN: r235436
Bin Cheng committed -
PR target/61821 * config/i386/i386.c (LARGECOMM_SECTION_ASM_OP): Define default. (x86_elf_aligned_common): Rename to ... (x86_elf_aligned_decl_common): ... this. Add decl arg. Switch to .lbss for largecomm object. Use LARGECOMM_SECTION_ASM_OP. * config/i386/i386-protos.h (x86_elf_aligned_common): Reflect renaming. * config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_COMMON): Rename to ... (ASM_OUTPUT_ALIGNED_DECL_COMMON): ... this. Pass new decl arg. * config/i386/sol2.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise. [!USE_GAS] (LARGECOMM_SECTION_ASM_OP): Define. From-SVN: r235435
Rainer Orth committed -
PR target/59407 * config/i386/i386.c (SECTION_LARGE): Define. (x86_64_elf_select_section): Set it for large data/bss sections. Only clear SECTION_WRITE for .lrodata. (x86_64_elf_section_type_flags): Set SECTION_LARGE for large data/bss sections. * config/i386/sol2.h (MACH_DEP_SECTION_ASM_FLAG): Define. * varasm.c (default_elf_asm_named_section): Grow flagchars. [MACH_DEP_SECTION_ASM_FLAG] Emit MACH_DEP_SECTION_ASM_FLAG for SECTION_MACH_DEP. * doc/tm.texi.in (Sections, MACH_DEP_SECTION_ASM_FLAG): Describe. * doc/tm.texi: Regenerate. From-SVN: r235434
Rainer Orth committed -
PR target/60290 * Makefile.am (GENERAL_FLAGS): Add -funwind-tables. * Makefile.in: Regenerate. From-SVN: r235432
Rainer Orth committed -
From-SVN: r235431
Bernd Schmidt committed -
PR bootstrap/70704 * configure.ac (--enable-stage1-checking): For --disable-checking or implicit --enable-checking, make sure extra flag matches in between stage1 and later checking. * configure: Regenerated. gcc/ * configure.ac (--enable-checking): Document extra flag, for non-release builds default to --enable-checking=yes,extra. If misc checking and extra checking, define CHECKING_P to 2 instead of 1. * common.opt (fchecking=): Add. * doc/invoke.texi (-fchecking=): Document. * doc/install.texi: Document --enable-checking changes. * configure: Regenerated. * config.in: Regenerated. gcc/cp/ * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of just flag_checking. From-SVN: r235430
Jakub Jelinek committed -
From-SVN: r235428
GCC Administrator committed
-
- 25 Apr, 2016 15 commits
-
-
* config/i386/i386.md (*movxi_internal_avx512f): Use insn type attribute instead of which_alternative. * config/i386/sse.md (*mov<mode>_internal): Ditto. Use EXT_REX_SSE_REG_P where appropriate. From-SVN: r235422
Uros Bizjak committed -
From-SVN: r235419
Joseph Myers committed -
* config/i386/predicates.md (const0_operand): Do not match const_wide_int code. (const1_operand): Ditto. From-SVN: r235417
Uros Bizjak committed -
i386.md (*movoi_internal_avx): Set mode attribute to XI for SSE constm1 operands and TARGET_AVX512VL. * config/i386/i386.md (*movoi_internal_avx): Set mode attribute to XI for SSE constm1 operands and TARGET_AVX512VL. (*movti_internal): Ditto. (*mov<mode>_or): Use constm1_operand predicate. * config/i386/sse.md (*mov<mode>_internal): Set mode attribute to XI for SSE vector_all_ones operands and TARGET_AVX512VL. * config/i386/predicates.md (constm1_operand): New predicate. * config/i386/i386.c (standard_sse_constant_opcode): Simplify emission of constant -1 load. From-SVN: r235416
Uros Bizjak committed -
From-SVN: r235415
Jason Merrill committed -
gcc/ * attribs.c (register_scoped_attributes): Fix logic. * attribs.h: Declare register_scoped_attributes. c-family/ * c-common.c (handle_unused_attribute): Accept CONST_DECL. No longer static. * c-common.h: Declare it. * c-lex.c (c_common_has_attribute): Add maybe_unused. cp/ * tree.c (std_attribute_table): New. (init_tree): Register it. From-SVN: r235414
Jason Merrill committed -
From-SVN: r235413
William Schmidt committed -
2016-04-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * rs6000-builtin.def: Correct pasto error for stxvd2x and stxvw4x built-in functions. From-SVN: r235412
Bill Schmidt committed -
Need to properly check if -march=i486 is really needed for -m32 build of libatomic on Linux/x86 and Linux/x86-64. PR target/70454 * configure.tgt (XCFLAGS): Revert the last change. From-SVN: r235411
H.J. Lu committed -
* config/msp430/msp430.md (ashlhi3): Optimize one bit shifts. (ashrhi3): Likewise. (lshrhi3): Likewise. From-SVN: r235410
DJ Delorie committed -
* config/msp430/cmpd.c (__mspabi_cmpf): Add prototype. (__mspabi_cmpd): Likewise. * config/msp430/floathidf.c (__floathidf): Likewise. * config/msp430/floathisf.c (__floathisf): Likewise * config/msp430/floatunhidf.c (__floatunssidf): Likewise. * config/msp430/floatunhisf.c (__floatunshisf): Likewise. * config/msp430/lib2shift.c (__ashlsi3): Take a signed char as the second parameter. (__ashrsi3): Likewise. From-SVN: r235409
Nick Clifton committed -
2016-04-25 Richard Biener <rguenther@suse.de> PR tree-optimization/70780 * tree-ssa-pre.c (compute_antic_aux): Also return true if the block wasn't visited yet. (compute_antic): Mark blocks with abnormal preds as visited as they have a final empty antic-in solution already. * gcc.dg/torture/pr70780.c: New testcase. From-SVN: r235407
Richard Biener committed -
2016-04-25 Michael Collison <michael.collison@linaro.org> * ChangeLog(2016-04-25): Fix ChangeLog formatting. From-SVN: r235403
Michael Collison committed -
2016-04-25 Michael Collison <michael.collison@linaro.org> * config/arm/neon.md (widen_<us>sum<mode>): New patterns where mode is VQI to improve mixed mode vectorization. * config/arm/neon.md (vec_sel_widen_ssum_lo<VQI:mode><VW:mode>3): New define_insn to match low half of signed vaddw. * config/arm/neon.md (vec_sel_widen_ssum_hi<VQI:mode><VW:mode>3): New define_insn to match high half of signed vaddw. * config/arm/neon.md (vec_sel_widen_usum_lo<VQI:mode><VW:mode>3): New define_insn to match low half of unsigned vaddw. * config/arm/neon.md (vec_sel_widen_usum_hi<VQI:mode><VW:mode>3): New define_insn to match high half of unsigned vaddw. * config/arm/arm.c (arm_simd_vect_par_cnst_half): New function. (arm_simd_check_vect_par_cnst_half_p): Likewise. * config/arm/arm-protos.h (arm_simd_vect_par_cnst_half): Prototype for new function. (arm_simd_check_vect_par_cnst_half_p): Likewise. * config/arm/predicates.md (vect_par_constant_high): Support big endian and simplify by calling arm_simd_check_vect_par_cnst_half (vect_par_constant_low): Likewise. * testsuite/gcc.target/arm/neon-vaddws16.c: New test. * testsuite/gcc.target/arm/neon-vaddws32.c: New test. * testsuite/gcc.target/arm/neon-vaddwu16.c: New test. * testsuite/gcc.target/arm/neon-vaddwu32.c: New test. * testsuite/gcc.target/arm/neon-vaddwu8.c: New test. * testsuite/lib/target-supports.exp (check_effective_target_vect_widen_sum_hi_to_si_pattern): Indicate that arm neon support vector widen sum of HImode TO SImode. From-SVN: r235402
Michael Collison committed -
From-SVN: r235401
GCC Administrator committed
-
- 24 Apr, 2016 6 commits
-
-
* config/i386/i386.md (*lea<mode>_general_4): Use const_0_to_3_operand predicate for operand 2. From-SVN: r235397
Uros Bizjak committed -
* config/i386/i386-protos.h (standard_sse_constant_p): Add machine_mode argument. * config/i386/i386.c (standard_sse_constant_p): Return 2 for constm1_rtx operands. For VOIDmode constants, get mode from pred_mode. Check mode size if the mode is supported by ABI. (standard_sse_constant_opcode): Do not use standard_constant_p. Strictly check ABI support for all-ones operands. (ix86_legitimate_constant_p): Handle TImode, OImode and XImode immediates. Update calls to standard_sse_constant_p. (ix86_expand_vector_move): Update calls to standard_sse_constant_p. (ix86_rtx_costs): Ditto. * config/i386/i386.md (*movxi_internal_avx512f): Use nonimmediate_or_sse_const_operand instead of vector_move_operand. Use (v,BC) alternative instead of (v,C). Use register_operand checks instead of MEM_P. (*movoi_internal_avx): Use nonimmediate_or_sse_const_operand instead of vector_move_operand. Add (v,BC) alternative and corresponding avx2 isa attribute. Use register_operand checks instead of MEM_P. (*movti_internal): Use nonimmediate_or_sse_const_operand for TARGET_SSE. Improve TARGET_SSE insn constraint. Add (v,BC) alternative and corresponding sse2 isa attribute. (*movtf_internal, *movdf_internal, *movsf_interal): Update calls to standard_sse_constant_p. (FP constant splitters): Ditto. * config/i386/constraints.md (BC): Do not use standard_sse_constant_p. (C): Ditto. * config/i386/predicates.md (constm1_operand): Remove. (nonimmediate_or_sse_const_operand): Rewrite using RTX. * config/i386/sse.md (*<avx512>_cvtmask2<ssemodesuffix><mode>): Use vector_all_ones_operand instead of constm1_operand. Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com> From-SVN: r235396
Uros Bizjak committed -
PR libstdc++/70762 * testsuite/util/testsuite_fs.h (__gnu_test::nonexistent_path): Use static counter to return a different path on every call. From-SVN: r235395
Jonathan Wakely committed -
gcc/ChangeLog: 2016-04-24 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * print-rtl.c (print_rtx_insn_vec): New function. * print-rtl.h: New prototype. * store-motion.c (struct st_expr): Make avail_stores a vector. (st_expr_entry): Adjust. (free_st_expr_entry): Likewise. (print_store_motion_mems): Likewise. (find_moveable_store): Likewise. (compute_store_table): Likewise. (delete_store): Likewise. (build_store_vectors): Likewise. From-SVN: r235394
Trevor Saunders committed -
gcc/ChangeLog: 2016-04-24 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * reorg.c (try_merge_delay_insns): Make merged_insns a vector. From-SVN: r235393
Trevor Saunders committed -
gcc/ChangeLog: 2016-04-24 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * vec.h (vec_safe_contains): New function. (vec::contains): Likewise. (vec::begin): Likewise. (vec::end): Likewise. From-SVN: r235392
Trevor Saunders committed
-