aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
AgeCommit message (Collapse)AuthorFilesLines
2012-05-04expr.c (get_def_for_expr_class): New function.Andrew Pinski1-4/+175
2012-05-04 Andrew Pinski <apinski@cavium.com> * expr.c (get_def_for_expr_class): New function. (convert_tree_comp_to_rtx): New function. (expand_cond_expr_using_cmove): New function. (expand_expr_real_2 <case COND_EXPR>): Call expand_cond_expr_using_cmove first and return if it succeeds. Remove the check for HAVE_conditional_move since we should have already converted it to a conditional move. * config/i386/i386.c (ix86_expand_int_movcc): Disallow comparison modes of DImode for 32bits and TImode. From-SVN: r187183
2012-04-26re PR middle-end/52940 (conversion from MODE_PARTIAL_INT uses sign extension ↵Bernd Schmidt1-7/+6
for unsigned types) PR middle-end/52940 * machmode.h (CLASS_HAS_WIDER_MODES_P): True for MODE_PARTIAL_INT. * expr.c (convert_move): Honor unsignedp when extending partial int modes. * genmodes.c (complete_mode): Don't clear component field of partial int modes. (emit_mode_inner): Don't emit it however. (calc_wider_mode): Partial int modes widen to their component. From-SVN: r186877
2012-04-23expr.c (expand_expr_real_1): Remove setting parent's alias set for ↵Martin Jambor1-11/+3
temporaries created for a bitfield... 2012-04-23 Martin Jambor <mjambor@suse.cz> * expr.c (expand_expr_real_1): Remove setting parent's alias set for temporaries created for a bitfield (reverting revision 122014). From-SVN: r186718
2012-04-17tree-flow.h (array_at_struct_end_p): Move declaration ...Richard Guenther1-0/+37
2012-04-17 Richard Guenther <rguenther@suse.de> * tree-flow.h (array_at_struct_end_p): Move declaration ... * tree.h (array_at_struct_end_p): ... here. * tree-ssa-loop-niter.c (array_at_struct_end_p): Move ... * expr.c (array_at_struct_end_p): ... here. Rewrite. From-SVN: r186527
2012-04-13expr.c (expand_expr_real_1): Pass type, not the expression, to ↵Martin Jambor1-2/+10
set_mem_attributes for a memory temporary. 2012-04-13 Martin Jambor <mjambor@suse.cz> * expr.c (expand_expr_real_1): Pass type, not the expression, to set_mem_attributes for a memory temporary. Do not call the function for the memory temporary created for a bitfield. From-SVN: r186426
2012-04-11re PR target/16458 (PowerPC - redundant compare)Peter Bergner1-2/+7
gcc/ PR target/16458 * rtlanal.c (unsigned_reg_p): New function. Update copyright notice dates. * rtl.h (unsigned_reg_p): Prototype it. Update copyright notice dates. * config/rs6000/rs6000.c (rs6000_generate_compare): Use it. Update comment. * expr.c (expand_expr_real_1): Set register attributes. * stmt.c (expand_case): Likewise. gcc/testsuite/ PR target/16458 * gcc.target/powerpc/pr16458-1.c: New test. * gcc.target/powerpc/pr16458-2.c: Likewise. * gcc.target/powerpc/pr16458-3.c: Likewise. * gcc.target/powerpc/pr16458-4.c: Likewise. Co-Authored-By: Michael Matz <matz@suse.de> From-SVN: r186312
2012-04-04expr.c (expand_expr_real_2): Handle larger sizetype in POINTER_PLUS_EXPR.Tristan Gingold1-0/+5
2012-04-04 Tristan Gingold <gingold@adacore.com> * expr.c (expand_expr_real_2): Handle larger sizetype in POINTER_PLUS_EXPR. From-SVN: r186133
2012-04-03expr.c (get_bit_range): Add OFFSET parameter and adjust BITPOS.Eric Botcazou1-7/+28
* expr.c (get_bit_range): Add OFFSET parameter and adjust BITPOS. Change type of BITOFFSET to signed. Make sure the lower bound of the computed range is non-negative by adjusting OFFSET and BITPOS. (expand_assignment): Adjust call to get_bit_range. From-SVN: r186110
2012-03-27expmed.c (store_bit_field): Assert that BITREGION_START is a multiple of a ↵Eric Botcazou1-0/+19
unit before computing the offset... * expmed.c (store_bit_field): Assert that BITREGION_START is a multiple of a unit before computing the offset in units. * expr.c (get_bit_range): Return the null range if the enclosing record is part of a larger bit field. From-SVN: r185857
2012-03-26toplev.c (check_global_declaration_1): Do not call assemble_external.Steven Bosscher1-16/+5
* toplev.c (check_global_declaration_1): Do not call assemble_external. * expr.c (emit_block_move_libcall_fn): Likewise. (clear_storage_libcall_fn): Likewise. (expand_expr_addr_expr_1): Likewise. (expand_expr_real_1): Likewise. * calls.c (rtx_for_function_call): Likewise. From-SVN: r185813
2012-03-24expr.c (optimize_bitfield_assignment_op): Use str_mode and str_bitsize ↵Eric Botcazou1-14/+9
instead of more convoluted expressions. * expr.c (optimize_bitfield_assignment_op) <BIT_IOR_EXPR>: Use str_mode and str_bitsize instead of more convoluted expressions. From-SVN: r185767
2012-03-20stor-layout.c (finish_bitfield_representative): Fallback to conservative ↵Richard Guenther1-7/+12
maximum size if the padding up to the next field... 2012-03-20 Richard Guenther <rguenther@suse.de> * stor-layout.c (finish_bitfield_representative): Fallback to conservative maximum size if the padding up to the next field cannot be computed as a constant. (finish_bitfield_layout): If we cannot compute the distance between the start of the bitfield representative and the bitfield member start a new representative. * expr.c (get_bit_range): The distance between the start of the bitfield representative and the bitfield member is zero if the field offsets are not constants. * gnat.dg/pack16.adb: New testcase. * gnat.dg/pack16_pkg.ads: Likewise. * gnat.dg/specs/pack8.ads: Likewise. * gnat.dg/specs/pack8_pkg.ads: Likewise. From-SVN: r185563
2012-03-19builtins.c (expand_builtin_cexpi): Use copy_addr_to_reg instead of ↵Uros Bizjak1-3/+3
copy_to_mode_reg (Pmode, ...). * builtins.c (expand_builtin_cexpi): Use copy_addr_to_reg instead of copy_to_mode_reg (Pmode, ...). (expand_builtin_frame_address): Ditto. * expr.c (emit_block_move_via_libcall): Ditto. (set_storage_via_libcall): Ditto. * config/i386/i386.c (ix86_expand_movmem): Ditto. (ix86_expand_setmem): Ditto. (ix86_trampoline_init): DItto. * config/i386/i386.md (cmpstrnsi): Ditto. (allocate_stack): Ditto. From-SVN: r185541
2012-03-16expr.c (expand_expr_real_1): handle misaligned scalar reads from memory ↵Martin Jambor1-14/+20
through MEM_REFs by calling... 2012-03-16 Martin Jambor <mjambor@suse.cz> * expr.c (expand_expr_real_1): handle misaligned scalar reads from memory through MEM_REFs by calling extract_bit_field. * testsuite/gcc.dg/misaligned-expand-1.c: New test. * testsuite/gcc.dg/misaligned-expand-3.c: Likewise. From-SVN: r185470
2012-03-16tree.h (TREE_VECTOR_CST_ELTS): Remove.Richard Guenther1-14/+17
2012-03-16 Richard Guenther <rguenther@suse.de> * tree.h (TREE_VECTOR_CST_ELTS): Remove. (VECTOR_CST_NELTS, VECTOR_CST_ELTS, VECTOR_CST_ELT): New defines. (struct tree_vector): Remove elements member, add variable size elts array member. (build_vector_stat): Declare. (build_vector): Define in terms of build_vector_stat. * tree.c (build_vector): Rename to ... (build_vector_stat): ... this. Take array of trees as parameter. (build_vector_from_ctor): Adjust. (integer_zerop, integer_onep, integer_all_onesp, iterative_hash_expr, initializer_zerop): Adjust. * cfgexpand.c (expand_debug_expr): Likewise. * expr.c (categorize_ctor_elements_1, expand_expr_real_1, const_vector_from_tree): Likewise. * fold-const.c (const_binop, operand_equal_p, native_encode_vector, native_interpret_vector, fold_unary_loc, vec_cst_ctor_to_array, fold_vec_perm, fold_binary_loc, fold_ternary_loc): Likewise. * tree-streamer-in.c (streamer_alloc_tree): Handle TS_VECTOR. (lto_input_ts_vector_tree_pointers): Adjust. * tree-streamer-out.c (streamer_write_tree_header): Handle TS_VECTOR. (write_ts_vector_tree_pointers): Adjust. * varasm.c (const_hash_1, compare_constant, copy_constant, output_constant): Adjust. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Adjust. * print-tree.c (print_node): Adjust. * tree-pretty-print.c (dump_generic_node): Adjust. * tree-vect-generic.c (uniform_vector_p, vector_element, lower_vec_perm): Adjust. * tree-vect-loop.c (get_initial_def_for_reduction): Adjust. * tree-vect-slp.c (vect_get_constant_vectors, vect_transform_slp_perm_load): Adjust. * tree-vect-stmts.c (vect_gen_perm_mask): Adjust. * expmed.c (make_tree): Adjust. * config/i386/i386.c (ix86_expand_builtin): Adjust. * config/sparc/sparc.c (sparc_handle_vis_mul8x16): Adjust interface and implementation. (sparc_fold_builtin): Adjust. c-family/ * c-pretty-print.c (pp_c_initializer_list): Adjust. From-SVN: r185458
2012-03-14expr.c (expand_assignment): Use expand_expr with EXPAND_WRITE when expanding ↵Martin Jambor1-61/+10
MEM_REFs... 2012-03-14 Martin Jambor <mjambor@suse.cz> * expr.c (expand_assignment): Use expand_expr with EXPAND_WRITE when expanding MEM_REFs, MEM_TARGET_REFs and handled_component bases. (expand_expr_real_1): Do not handle misalignment if modifier is EXPAND_WRITE. From-SVN: r185389
2012-03-14re PR target/52080 (Stores to bitfields introduce a store-data-race on ↵Richard Guenther1-95/+24
adjacent data) 2012-03-14 Richard Guenther <rguenther@suse.de> * tree.h (DECL_BIT_FIELD_REPRESENTATIVE): New define. * stor-layout.c (start_bitfield_representative): New function. (finish_bitfield_representative): Likewise. (finish_bitfield_layout): Likewise. (finish_record_layout): Call finish_bitfield_layout. * tree.c (free_lang_data_in_decl): Only free DECL_QUALIFIER for QUAL_UNION_TYPE fields. * tree-streamer-in.c (lto_input_ts_field_decl_tree_pointers): Stream DECL_BIT_FIELD_REPRESENTATIVE. * tree-streamer-out.c (write_ts_field_decl_tree_pointers): Likewise. PR middle-end/52080 PR middle-end/52097 PR middle-end/48124 * expr.c (get_bit_range): Unconditionally extract bitrange from DECL_BIT_FIELD_REPRESENTATIVE. (expand_assignment): Adjust call to get_bit_range. * gcc.dg/torture/pr48124-1.c: New testcase. * gcc.dg/torture/pr48124-2.c: Likewise. * gcc.dg/torture/pr48124-3.c: Likewise. * gcc.dg/torture/pr48124-4.c: Likewise. From-SVN: r185379
2012-03-13expr.c (expand_assignment): Handle misaligned scalar writes to memory ↵Martin Jambor1-7/+15
through top-level MEM_REFs by calling... 2012-03-13 Martin Jambor <mjambor@suse.cz> * expr.c (expand_assignment): Handle misaligned scalar writes to memory through top-level MEM_REFs by calling store_bit_field. * testsuite/gcc.dg/misaligned-expand-2.c: New test. From-SVN: r185336
2012-03-07coverage.c (get_gcov_type): Use type_for_mode.Richard Guenther1-4/+3
2012-03-07 Richard Guenther <rguenther@suse.de> * coverage.c (get_gcov_type): Use type_for_mode. (get_gcov_unsigned_t): Likewise. * expr.c (store_constructor): Use type_for_mode. (try_casesi): Likewise. * tree-ssa-loop-ivopts.c (add_standard_iv_candidates_for_size): Remove. (add_standard_iv_candidates): Use standard type trees. * dojump.c (do_jump): Remove dead code. From-SVN: r185048
2012-02-29re PR middle-end/52419 (Wrong expansion of misaligned vector store)Jakub Jelinek1-20/+37
PR middle-end/52419 * expr.c (expand_assignment): If doing misaligned store that doesn't cover all mode bits, perform a RMW cycle. * gcc.dg/torture/pr52419.c: New test. From-SVN: r184666
2012-02-13re PR middle-end/52209 (wrong code at -O0)Jakub Jelinek1-2/+3
PR middle-end/52209 * expr.c (expand_expr_real_2) <case BIT_NOT_EXPR>: Only expand using XOR for reduce_bit_field if type is unsigned. * gcc.c-torture/execute/pr52209.c: New test. From-SVN: r184151
2012-02-07re PR middle-end/51994 (git-1.7.8.3 miscompiled due to negative bitpos from ↵Eric Botcazou1-0/+18
get_inner_reference) PR middle-end/51994 * expr.c (get_inner_reference): If there is an offset, add a negative bit position to it (if any). From-SVN: r183974
2012-02-07re PR middle-end/52074 (ICE: RTL flag check: MEM_VOLATILE_P used with ↵Jakub Jelinek1-2/+11
unexpected rtx code 'plus' in extract_fixed_bit_field, at expmed.c:1734) PR middle-end/52074 * expr.c (expand_expr_addr_expr_1): For CONSTANT_CLASS_P or CONST_DECL if modifier < EXPAND_SUM call force_operand on the result. * gcc.c-torture/compile/pr52074.c: New test. From-SVN: r183956
2012-01-27re PR tree-optimization/50444 (-ftree-sra ignores alignment)Richard Guenther1-60/+100
2012-01-27 Richard Guenther <rguenther@suse.de> PR tree-optimization/50444 * expr.c (mem_ref_refers_to_non_mem_p): New function. (expand_assignment): Use it. Properly handle misaligned bases when expanding stores to component references. (expand_expr_real_1): Use mem_ref_refers_to_non_mem_p and refactor that case. From-SVN: r183629
2012-01-27re PR middle-end/51959 (ICE in set_mem_alias_set, at emit-rtl.c:1884)Richard Guenther1-1/+1
2012-01-27 Richard Guenther <rguenther@suse.de> PR middle-end/51959 * expr.c (store_field): Use the alias-set of the scratch memory for storing to it. * g++.dg/torture/pr51959.C: New testcase. From-SVN: r183616
2012-01-26re PR middle-end/51895 (ICE in simplify_subreg)Jakub Jelinek1-0/+10
PR middle-end/51895 * expr.c (expand_expr_real_1): Handle BLKmode MEM_REF of non-addressable non-BLKmode base correctly. * g++.dg/opt/pr51895.C: New test. From-SVN: r183560
2012-01-24rtl.texi (MEM_IN_STRUCT_P, [...]): Delete.Richard Sandiford1-2/+0
gcc/ * doc/rtl.texi (MEM_IN_STRUCT_P, MEM_SCALAR_P): Delete. (in_struct, return_val): Remove MEM documentation. * rtl.h (rtx_def): Remove MEM meanings from in_struct and return_val. (MEM_IN_STRUCT_P, MEM_SCALAR_P): Delete. (MEM_COPY_ATTRIBUTES): Remove references to MEM_IN_STRUCT_P and MEM_SCALAR. * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. * cfgexpand.c (add_alias_set_conflicts): Likewise. * expr.c (store_field): Likewise. * function.c (assign_stack_temp_for_type): Likewise. * ifcvt.c (noce_try_cmove_arith): Likewise. * reload1.c (reload): Likewise. * config/alpha/alpha.c (alpha_set_memflags_1): Likewise. (alpha_set_memflags): Likewise. * config/m32c/m32c.c (m32c_immd_dbl_mov): Nullify. gcc/testsuite/ * gcc.dg/memcpy-4.c: Don't expect /s on MEMs. From-SVN: r183486
2012-01-24rtl.h (true_dependence, [...]): Remove varies parameter.Richard Sandiford1-2/+1
gcc/ * rtl.h (true_dependence, canon_true_dependence): Remove varies parameter. * alias.c (fixed_scalar_and_varying_struct_p): Delete. (true_dependence_1, write_dependence_p, may_alias_p): Don't call it. (true_dependence_1, true_dependence, canon_true_dependence): Remove varies parameter. * cselib.c (cselib_rtx_varies_p): Delete. (cselib_invalidate_mem): Update call to canon_true_dependence. * dse.c (record_store, check_mem_read_rtx): Likewise. (scan_reads_nospill): Likewise. * cse.c (check_dependence): Likewise. (cse_rtx_varies_p): Delete. * expr.c (safe_from_p): Update call to true_dependence. * ira.c (validate_equiv_mem_from_store): Likewise. (memref_referenced_p): Likewise. * postreload-gcse.c (find_mem_conflicts): Likewise. * sched-deps.c (sched_analyze_2): Likewise. * store-motion.c (load_kills_store): Likewise. * config/frv/frv.c (frv_registers_conflict_p_1): Likewise. * gcse.c (mems_conflict_for_gcse_p): Likewise. (compute_transp): Update call to canon_true_dependence. From-SVN: r183485
2012-01-24[multiple changes]Richard Guenther1-0/+22
2012-01-24 Richard Guenther <rguenther@suse.de> Forward-port to trunk 2010-09-21 Jakub Jelinek <jakub@redhat.com> PR middle-end/45678 * expr.c (expand_expr_real_1) <case VIEW_CONVERT_EXPR>: If op0 isn't sufficiently aligned and there is movmisalignM insn for mode, use it to load op0 into a temporary register. From-SVN: r183470
2012-01-17re PR middle-end/51782 (-ftree-sra: Missing address-space information leads ↵Richard Guenther1-4/+6
to wrong) 2012-01-17 Richard Guenther <rguenther@suse.de> PR middle-end/51782 * expr.c (expand_assignment): Take address-space information from the address operand of MEM_REF and TARGET_MEM_REF. (expand_expr_real_1): Likewise. From-SVN: r183249
2012-01-11re PR bootstrap/51796 (internal compiler error: in distribute_notes, at ↵Jakub Jelinek1-5/+12
combine.c:13285 for libgomp/alloc.c on m68k-linux) PR bootstrap/51796 * combine.c (distribute_notes): If i3 is a noreturn call, allow old_size to be equal to args_size and make sure the noreturn call gets REG_ARGS_SIZE note. * expr.c (fixup_args_size_notes): Put REG_ARGS_SIZE notes on noreturn calls even when the delta is 0. * gcc.dg/pr51796.c: New test. From-SVN: r183111
2012-01-02expr.h (move_by_pieces_ninsns): Declare.Richard Sandiford1-4/+1
gcc/ * expr.h (move_by_pieces_ninsns): Declare. * expr.c (move_by_pieces_ninsns): Make external. * config/mips/mips-protos.h (mips_move_by_pieces_p): Declare. (mips_store_by_pieces_p): Likewise. * config/mips/mips.h (MOVE_BY_PIECES_P): Call mips_move_by_pieces_p. (STORE_BY_PIECES_P): Likewise mips_store_by_pieces_p. * config/mips/mips.c (mips_move_by_pieces_p): New function. (mips_store_by_pieces_p): Likewise. gcc/testsuite/ * gcc.dg/memcpy-4.c: Add nomips16 attribute for MIPS targets. Increase copy to 5 bytes. Look for at least two "mem/s/u"s, rather than a specific number. From-SVN: r182801
2011-12-23Delete VEC_EXTRACT_EVEN/ODD_EXPR.Richard Henderson1-4/+0
* tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR): Remove. * cfgexpand.c (expand_debug_expr): Don't handle them. * expr.c (expand_expr_real_2): Likewise. * fold-const.c (fold_binary_loc): Likewise. * gimple-pretty-print.c (dump_binary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (can_vec_perm_for_code_p): Remove. (expand_binop): Don't try it. (init_optabs): Don't init vec_extract_even/odd_optab. * genopinit.c (optabs): Likewise. * optabs.h (OTI_vec_extract_even, OTI_vec_extract_odd): Remove. (vec_extract_even_optab, vec_extract_odd_optab): Remove. * tree-vect-data-refs.c (vect_strided_store_supported): Tidy code. (vect_permute_store_chain): Use TYPE_VECTOR_SUBPARTS instead of GET_MODE_NUNITS; check vect_gen_perm_mask return value instead of asserting vect_strided_store_supported. (vect_strided_load_supported): Use can_vec_perm_p. (vect_permute_load_chain): Use VEC_PERM_EXPR. * doc/generic.texi (VEC_EXTRACT_EVEN_EXPR): Remove. (VEC_EXTRACT_ODD_EXPR): Remove. * doc/md.texi (vec_extract_even, vec_extract_odd): Remove. From-SVN: r182669
2011-12-23Delete VEC_INTERLEAVE_*_EXPR.Jakub Jelinek1-2/+0
* tree.def (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove. * gimple-pretty-print.c (dump_binary_rhs): Don't handle VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. * expr.c (expand_expr_real_2): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * fold-const.c (fold_binary_loc): Likewise. * doc/generic.texi (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove documentation. * optabs.c (optab_for_tree_code): Don't handle VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. (expand_binop, init_optabs): Remove vec_interleave_high_optab and vec_interleave_low_optab. * genopinit.c (optabs): Likewise. * optabs.h (OTI_vec_interleave_high, OTI_vec_interleave_low): Remove. (vec_interleave_high_optab, vec_interleave_low_optab): Remove. * doc/md.texi (vec_interleave_high, vec_interleave_low): Remove documentation. * tree-vect-stmts.c (gen_perm_mask): Renamed to... (vect_gen_perm_mask): ... this. No longer static. (perm_mask_for_reverse, vectorizable_load): Adjust callers. * tree-vectorizer.h (vect_gen_perm_mask): New prototype. * tree-vect-data-refs.c (vect_strided_store_supported): Don't try VEC_INTERLEAVE_*_EXPR, use can_vec_perm_p instead of can_vec_perm_for_code_p. (vect_permute_store_chain): Generate VEC_PERM_EXPR with interleaving masks instead of VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. * config/i386/i386.c (expand_vec_perm_interleave2): If expand_vec_perm_interleave3 would handle it, return false. (expand_vec_perm_broadcast_1): Don't use vec_interleave_*_optab. From-SVN: r182663
2011-12-20expr.c (store_field): Avoid a direct store if the mode is larger than the ↵Bernd Schmidt1-0/+2
size of the bit field. gcc/ * expr.c (store_field): Avoid a direct store if the mode is larger than the size of the bit field. * stor-layout.c (layout_decl): If flag_strict_volatile_bitfields, treat non-volatile bit fields like volatile ones. * toplev.c (process_options): Disallow combination of -fstrict-volatile-bitfields and ABI versions less than 2. * config/arm/arm.c (arm_option_override): Don't enable flag_strict_volatile_bitfields if the ABI version is less than 2. * config/h8300/h8300.c (h8300_option_override): Likewise. * config/rx/rx.c (rx_option_override): Likewise. * config/m32c/m32c.c (m32c_option_override): Likewise. * config/sh/sh.c (sh_option_override): Likewise. gcc/testsuite/ * gcc.target/arm/volatile-bitfields-4.c: New test. * c-c++-common/abi-bf.c: New test. From-SVN: r182545
2011-12-13Revert two unintended commitsRichard Henderson1-0/+2
From-SVN: r182301
2011-12-13Delete VEC_INTERLEAVE_*_EXPR.Richard Henderson1-2/+0
* tree.def (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove. * gimple-pretty-print.c (dump_binary_rhs): Don't handle VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. * expr.c (expand_expr_real_2): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * fold-const.c (fold_binary_loc): Likewise. * doc/generic.texi (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove documentation. * optabs.c (optab_for_tree_code): Don't handle VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. (expand_binop, init_optabs): Remove vec_interleave_high_optab and vec_interleave_low_optab. * genopinit.c (optabs): Likewise. * optabs.h (OTI_vec_interleave_high, OTI_vec_interleave_low): Remove. (vec_interleave_high_optab, vec_interleave_low_optab): Remove. * doc/md.texi (vec_interleave_high, vec_interleave_low): Remove documentation. * tree-vect-stmts.c (gen_perm_mask): Renamed to... (vect_gen_perm_mask): ... this. No longer static. (perm_mask_for_reverse, vectorizable_load): Adjust callers. * tree-vectorizer.h (vect_gen_perm_mask): New prototype. * tree-vect-data-refs.c (vect_strided_store_supported): Don't try VEC_INTERLEAVE_*_EXPR, use can_vec_perm_p instead of can_vec_perm_for_code_p. (vect_permute_store_chain): Generate VEC_PERM_EXPR with interleaving masks instead of VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. * config/i386/i386.c (expand_vec_perm_interleave2): If expand_vec_perm_interleave3 would handle it, return false. (expand_vec_perm_broadcast_1): Don't use vec_interleave_*_optab. From-SVN: r182298
2011-12-10Force the creation of a CONST_VECTOR for expand_vec_perm.Richard Henderson1-0/+17
* expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Avoid passing a CONST_INT to expand_vec_perm as the selector. * optabs.c (expand_vec_perm): Assert the selector is of a proper mode. From-SVN: r182192
2011-12-08re PR tree-optimization/51315 (unaligned memory accesses generated with ↵Eric Botcazou1-21/+0
-ftree-sra) PR tree-optimization/51315 * tree.h (get_object_or_type_alignment): Declare. * expr.c (get_object_or_type_alignment): Move to... * builtins.c (get_object_or_type_alignment): ...here. Add assertion. * tree-sra.c (tree_non_mode_aligned_mem_p): Rename to... (tree_non_aligned_mem_p): ...this. Add ALIGN parameter. Look into MEM_REFs and use get_object_or_type_alignment for them. (build_accesses_from_assign): Adjust for above change. (access_precludes_ipa_sra_p): Likewise. From-SVN: r182102
2011-12-07re PR middle-end/45416 (Code size regression from 4.4 for ARM)Andrew Pinski1-7/+14
2011-12-07 Andrew Pinski <apinski@cavium.com> PR middle-end/45416 * expr.c (do_store_flag): Rewrite code that looks for BIT_AND_EXPR for SSA-expand. 2011-12-07 Andrew Pinski <apinski@cavium.com> PR middle-end/45416 * gcc.dg/pr45416.c: New testcase. From-SVN: r182084
2011-11-29re PR middle-end/50074 (gcc.dg/sibcall-6.c execution test on x86_64 with -fPIC)Jakub Jelinek1-1/+2
PR middle-end/50074 * expr.c (expand_expr_addr_expr_1): Don't call force_operand for EXPAND_SUM modifier. From-SVN: r181800
2011-11-21expr.c (expand_expr_real_1): Correctly handle strict volatile bitfield loads ↵Joey Ye1-3/+8
smaller than mode size. 2011-11-20 Joey Ye <joey.ye@arm.com> * expr.c (expand_expr_real_1): Correctly handle strict volatile bitfield loads smaller than mode size. testsuite: * gcc.dg/volatile-bitfields-1.c: New. From-SVN: r181549
2011-10-25Implement interleave via permutation.Richard Henderson1-19/+1
* expr.c (expand_expr_real_2) [VEC_EXTRACT_EVEN_EXPR]: Use binop. [VEC_EXTRACT_ODD_EXPR, VEC_INTERLEAVE_HIGH_EXPR]: Likewise. [VEC_INTERLEAVE_LOW_EXPR]: Likewise. * optabs.c (expand_binop): Implement vec_interleave_high_optab, vec_interleave_low_optab, vec_extract_even_optab, vec_extract_odd_optab with expand_vec_perm. (can_vec_perm_for_code_p): New. * optabs.h: Update. * tree-vect-data-refs.c (vect_strided_store_supported): Allow for fallback via can_vec_perm_for_code_p. (vect_strided_load_supported): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Never lower VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR, VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR. From-SVN: r180450
2011-10-25Change vec_perm checking and expansion level.Richard Henderson1-3/+5
The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-18md.texi (vec_widen_ushiftl_hi, [...]): Document.Ira Rosen1-0/+13
* doc/md.texi (vec_widen_ushiftl_hi, vec_widen_ushiftl_lo, vec_widen_sshiftl_hi, vec_widen_sshiftl_lo): Document. * tree-pretty-print.c (dump_generic_node): Handle WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (op_code_prio): Likewise. (op_symbol_code): Handle WIDEN_LSHIFT_EXPR. * optabs.c (optab_for_tree_code): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (init-optabs): Initialize optab codes for vec_widen_u/sshiftl_hi/lo. * optabs.h (enum optab_index): Add OTI_vec_widen_u/sshiftl_hi/lo. * genopinit.c (optabs): Initialize the new optabs. * expr.c (expand_expr_real_2): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. * gimple-pretty-print.c (dump_binary_rhs): Likewise. * tree-vectorizer.h (NUM_PATTERNS): Increase to 8. * tree.def (WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR, VEC_WIDEN_LSHIFT_LO_EXPR): New. * cfgexpand.c (expand_debug_expr): Handle new tree codes. * tree-vect-patterns.c (vect_vect_recog_func_ptrs): Add vect_recog_widen_shift_pattern. (vect_handle_widen_mult_by_const): Rename... (vect_handle_widen_op_by_const): ...to this. Handle shifts. Add a new argument, update documentation. (vect_recog_widen_mult_pattern): Assume that only second operand can be constant. Update call to vect_handle_widen_op_by_const. (vect_recog_over_widening_pattern): Fix typo. (vect_recog_widen_shift_pattern): New. * tree-vect-stmts.c (vectorizable_type_promotion): Handle widening shifts. (supportable_widening_operation): Likewise. * tree-inline.c (estimate_operator_cost): Handle new tree codes. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * config/arm/neon.md (neon_vec_<US>shiftl_<mode>): New. (vec_widen_<US>shiftl_lo_<mode>, neon_vec_<US>shiftl_hi_<mode>, vec_widen_<US>shiftl_hi_<mode>, neon_vec_<US>shift_left_<mode>): Likewise. * config/arm/predicates.md (const_neon_scalar_shift_amount_operand): New. * config/arm/iterators.md (V_innermode): New. * tree-vect-slp.c (vect_build_slp_tree): Require same shift operand for widening shift. From-SVN: r180128
2011-10-18re PR middle-end/50716 (Segmentation fault caused by misaligned vector access)Richard Guenther1-9/+30
2011-10-18 Richard Guenther <rguenther@suse.de> PR middle-end/50716 * expr.c (get_object_or_type_alignment): New function. (expand_assignment): Use it. (expand_expr_real_1): Likewise. From-SVN: r180125
2011-10-12expr.h (copy_blkmode_to_reg): Declare.Richard Sandiford1-7/+123
gcc/ * expr.h (copy_blkmode_to_reg): Declare. * expr.c (copy_blkmode_to_reg): New function. (expand_assignment): Don't expand register RESULT_DECLs before the lhs. Use copy_blkmode_to_reg to copy BLKmode values into a RESULT_DECL register. (expand_expr_real_1): Handle BLKmode decls when looking for promotion. * stmt.c (expand_return): Move BLKmode-to-register code into copy_blkmode_to_reg. From-SVN: r179839
2011-10-07Rename vshuffle/vec_shuffle to vec_perm.Richard Henderson1-3/+4
* doc/extend.texi (__builtin_shuffle): Improve the description to include the modulus of the selector. Mention OpenCL. * doc/md.texi (vec_perm, vec_perm_const): Document named patterns. * tree.def (VEC_PERM_EXPR): Rename from VEC_SHUFFLE_EXPR. * genopinit.c (optabs): Rename vshuffle to vec_perm. * c-typeck.c (c_build_vec_perm_expr): Rename from c_build_vec_shuffle_expr. Update for name changes. * optabs.c (expand_vec_perm_expr_p): Rename from expand_vec_shuffle_expr_p. (expand_vec_perm_expr): Rename from expand_vec_shuffle_expr. * optabs.h (OTI_vec_perm): Rename from DOI_vshuffle. (vec_perm_optab): Rename from vshuffle_optab. * expr.c, gimple-pretty-print.c, gimple.c, gimplify.c, c-tree.h, c-parser.c, tree-cfg.c, tree-inline.c, tree-pretty-print.c, tree-ssa-operands.c, tree-vect-generic.c: Update for name changes. * config/i386/i386.c (ix86_expand_vec_perm): Rename from ix86_expand_vshuffle. * config/i386/i386-protos.h: Update. * config/i386/sse.md (VEC_PERM_AVX2): Rename from VSHUFFLE_AVX2. (vec_perm<VEC_PERM_AVX2>): Rename from vshuffle<VSHUFFLE_AVX2>. From-SVN: r179701
2011-10-03Vector shuffling patch from Artem Shinkarov.Artjoms Sinkarovs1-0/+15
From-SVN: r179462
2011-09-29expr.c (do_store_flag): Expand vector comparison by building an appropriate ↵Artjoms Sinkarovs1-0/+11
VEC_COND_EXPR. 2011-09-29 Artjoms Sinkarovs <artyom.shinkaroff@gmail.com> * expr.c (do_store_flag): Expand vector comparison by building an appropriate VEC_COND_EXPR. * c-typeck.c (build_binary_op): Typecheck vector comparisons. (c_objc_common_truthvalue_conversion): Adjust. * tree-vect-generic.c (do_compare): Helper function. (expand_vector_comparison): Check if hardware supports vector comparison of the given type or expand vector piecewise. (expand_vector_operation): Treat comparison as binary operation of vector type. (expand_vector_operations_1): Adjust. * gcc.c-torture/execute/vector-compare-1.c: New testcase. * gcc.c-torture/execute/vector-compare-2.c: Likewise. * gcc.dg/vector-compare-1.c: Likewise. * gcc.dg/vector-compare-2.c: Likewise. From-SVN: r179342