aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-06emit-rtl.c (paradoxical_subreg_p): New function.Bernd Schmidt1-3/+1
* emit-rtl.c (paradoxical_subreg_p): New function. * rtl.h (paradoxical_subreg_p): Declare. * combine.c (set_nonzero_bits_and_sign_copies, get_last_value, apply_distributive_law, simplify_comparison, simplify_set): Use it. * cse.c (record_jump_cond, cse_insn): Likewise. * expr.c (force_operand): Likewise. * rtlanal.c (num_sign_bit_copies1): Likewise. * reload1.c (eliminate_regs_1, strip_paradoxical_subreg): Likewise. * reload.c (push_secondary_reload, find_reloads_toplev): Likewise. (push_reload): Use precision to check for paradoxical subregs. * expmed.c (extract_bit_field_1): Likewise. From-SVN: r175944
2011-07-06machmode.h (TRULY_NOOP_TRUNCATION_MODES_P): New macro.Bernd Schmidt1-6/+4
* machmode.h (TRULY_NOOP_TRUNCATION_MODES_P): New macro. * combine.c (make_extraction, gen_lowpart_or_truncate, apply_distributive_law, simplify_comparison, reg_truncated_to_mode, record_truncated_value): Use it. * cse.c (notreg_cost): Likewise. * expmed.c (store_bit_field_1, extract_bit_field_1): Likewise. * expr.c (convert_move, convert_modes): Likewise. * optabs.c (expand_binop, expand_unop): Likewise. * postreload.c (move2add_last_label): Likewise. * regmove.c (optimize_reg_copy_3): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * simplify-rtx.c (simplify_unary_operation_1): Likewise. From-SVN: r175921
2011-07-06cse.c (find_comparison_args): Use val_mode_signbit_set_p.Bernd Schmidt1-4/+3
* cse.c (find_comparison_args): Use val_mode_signbit_set_p. * simplify-rtx.c (mode_signbit_p): Use GET_MODE_PRECISION. (val_mode_signbit_p, val_mode_signbit_set_p): New functions. (simplify_const_unary_operation, simplify_binary_operation_1, simplify_const_binary_operation, simplify_const_relational_operation): Use them. Use GET_MODE_MASK for masking and sign-extensions. * combine.c (set_nonzero_bits_and_sign_copies, simplify_set, combine_simplify_rtx, force_to_mode, reg_nonzero_bits_for_combine, simplify_shift_const_1, simplify_comparison): Likewise. * expr.c (convert_modes): Likewise. * rtlanal.c (nonzero_bits1, canonicalize_condition): Likewise. * expmed.c (emit_cstore, emit_store_flag_1, emit_store_flag): Likewise. * rtl.h (val_mode_signbit_p, val_mode_signbit_set_p): Declare. From-SVN: r175917
2011-06-24re PR rtl-optimization/49429 (dse.c change (r175063) causes execution failures)Easwaran Raman1-2/+13
2011-06-24 Easwaran Raman <eraman@google.com> PR rtl-optimization/49429 PR target/49454 * expr.c (emit_block_move_hints): Mark MEM_EXPR(x) and MEM_EXPR(y) addressable if emit_block_move_via_libcall is used to copy y into x. * calls.c (initialize_argument_information): Mark an argument addressable if it is passed by invisible reference. (emit_library_call_value_1): Mark MEM_EXPR (val) addressable if it is passed by reference. From-SVN: r175384
2011-06-16re PR middle-end/46500 (target.h includes tm.h)Joern Rennecke1-5/+7
PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-15expr.c (expand_expr_real_2): Reduce all integral types to bitfield precision.Richard Guenther1-2/+2
2011-06-15 Richard Guenther <rguenther@suse.de> * expr.c (expand_expr_real_2): Reduce all integral types to bitfield precision. (expand_expr_real_1): Likewise. From-SVN: r175078
2011-06-15target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h.Joseph Myers1-1/+2
* target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-05-23re PR middle-end/48973 (Inliner bug with one-bit (1-bit) bitfield)Jakub Jelinek1-3/+9
PR middle-end/48973 * expr.c (expand_expr_real_2) <case LT_EXPR>: If do_store_flag failed and the comparison has a single bit signed type, use constm1_rtx instead of const1_rtx for true value. (do_store_flag): If ops->type is single bit signed type, disable signel bit test optimization and pass -1 instead of 1 as last parameter to emit_store_flag_force. * gcc.c-torture/execute/pr48973-1.c: New test. * gcc.c-torture/execute/pr48973-2.c: New test. From-SVN: r174060
2011-05-04tree.h (int_const_binop): Remove notrunc argument.Richard Guenther1-1/+1
2011-05-04 Richard Guenther <rguenther@suse.de> * tree.h (int_const_binop): Remove notrunc argument. * fold-const.c (int_const_binop): Remove notrunc argument. Always create integer constants that are properly truncated. (extract_muldiv_1): Expand one notrunc int_const_binop caller. (const_binop): Remove zero notrunc argument to int_const_binop. (size_binop_loc): Likewise. (fold_div_compare): Likewise. (maybe_canonicalize_comparison_1): Likewise. (fold_comparison): Likewise. (fold_binary_loc): Likewise. (multiple_of_p): Likewise. * expr.c (store_constructor): Likewise. * gimple-fold.c (maybe_fold_offset_to_array_ref): Likewise. (maybe_fold_stmt_addition): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * stor-layout.c (layout_type): Likewise. * tree-data-ref.c (tree_fold_divides_p): Likewise. * tree-sra.c (build_ref_for_offset): Likewise. (build_user_friendly_ref_for_offset): Likewise. * tree-ssa-address.c (maybe_fold_tmr): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise. * tree-ssa-loop-niter.c (inverse): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. * tree-ssa.c (maybe_rewrite_mem_ref_base): Likewise. * tree-switch-conversion.c (check_range): Likewise. (build_constructors): Likewise. * tree-vect-generic.c (expand_vector_piecewise): Likewise. * tree-vrp.c (set_and_canonicalize_value_range): Likewise. (extract_range_from_assert): Likewise. (vrp_int_const_binop): Likewise. (extract_range_from_binary_expr): Likewise. (extract_range_from_unary_expr): Likewise. (check_array_ref): Likewise. (find_case_label_range): Likewise. (simplify_div_or_mod_using_ranges): Likewise. * tree-cfg.c (group_case_labels_stmt): Use double-ints for comparing case labels for merging. ada/ * gcc-interface/trans.c (gnat_to_gnu): Remove zero notrunc argument to int_const_binop. (pos_to_constructor): Likewise. fortran/ * trans-types.c (gfc_get_array_type_bounds): Remove zero notrunc argument to int_const_binop. From-SVN: r173356
2011-04-29expr.h (expand_shift): Rename to ...Richard Guenther1-25/+18
2011-04-29 Richard Guenther <rguenther@suse.de> * expr.h (expand_shift): Rename to ... (expand_variable_shift): ... this. (expand_shift): Take a constant shift amount. * expmed.c (expand_shift): Rename to ... (expand_variable_shift): ... this. (expand_shift): New wrapper around expand_variable_shift. * expr.c (convert_move, emit_group_load_1, emit_group_store, optimize_bitfield_assignment_op, store_field, expand_expr_real_2, expand_expr_real_1, reduce_to_bit_field_precision): Adjust. * expmed.c (store_fixed_bit_field, extract_bit_field_1, extract_fixed_bit_field, extract_split_bit_field, expand_mult_const, expand_mult, expand_widening_mult, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, emit_cstore, emit_store_flag_1, emit_store_flag): Likewise. * builtins.c (expand_builtin_signbit): Likewise. * calls.c (load_register_parameters): Likewise. * function.c (assign_parm_setup_block): Likewise. * lower-subreg.c (resolve_shift_zext): Likewise. * optabs.c (widen_bswap, expand_abs_nojump, expand_one_cmpl_abs_nojump, expand_float): Likewise. * spu/spu.c (spu_expand_extv): Likewise. * sparc/sparc.c (sparc32_initialize_trampoline): Likewise. From-SVN: r173157
2011-04-21target.def (legitimate_constant_p): New hook.Richard Sandiford1-7/+7
gcc/ * target.def (legitimate_constant_p): New hook. * doc/tm.texi.in (LEGITIMATE_CONSTANT_P): Replace with... (TARGET_LEGITIMATE_CONSTANT_P): ...this. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_mode_rtx_true): Declare. * hooks.c (hook_bool_mode_rtx_true): Define. * system.h (LEGITIMATE_CONSTANT_P): Poison. * calls.c (precompute_register_parameters): Replace uses of LEGITIMATE_CONSTANT_P with targetm.legitimate_constant_p. (emit_library_call_value_1): Likewise. * expr.c (move_block_to_reg, can_store_by_pieces, emit_move_insn) (compress_float_constant, emit_push_insn, expand_expr_real_1): Likewise. * ira-costs.c (scan_one_insn): Likewise. * recog.c (general_operand, immediate_operand): Likewise. * reload.c (find_reloads_toplev, find_reloads_address_part): Likewise. * reload1.c (init_eliminable_invariants): Likewise. * config/alpha/alpha-protos.h (alpha_legitimate_constant_p): Add a mode argument. * config/alpha/alpha.h (LEGITIMATE_CONSTANT_P): Delete. * config/alpha/alpha.c (alpha_legitimate_constant_p): Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/alpha/predicates.md (input_operand): Update call to alpha_legitimate_constant_p. * config/arm/arm-protos.h (arm_cannot_force_const_mem): Delete. * config/arm/arm.h (ARM_LEGITIMATE_CONSTANT_P): Likewise. (THUMB_LEGITIMATE_CONSTANT_P, LEGITIMATE_CONSTANT_P): Likewise. * config/arm/arm.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (arm_legitimate_constant_p_1, thumb_legitimate_constant_p) (arm_legitimate_constant_p): New functions. (arm_cannot_force_const_mem): Make static. * config/avr/avr.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_constant_p): Delete. * config/bfin/bfin.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin.c (expand_move): Use targetm.legitimate_constant_p instead of bfin_legitimate_constant_p. (bfin_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/cris/cris.h (LEGITIMATE_CONSTANT_P): Delete. * config/fr30/fr30.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_constant_p): Delete. * config/frv/frv.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (frv_legitimate_constant_p): Make static. Add a mode argument. * config/h8300/h8300-protos.h (h8300_legitimate_constant_p): Delete. * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/h8300/h8300.c (h8300_legitimate_constant_p): Likewise. * config/i386/i386-protos.h (legitimate_constant_p): Delete. * config/i386/i386.h (LEGITIMATE_CONSTANT_P): Likewise. * config/i386/i386.c (legitimate_constant_p): Rename to... (ix86_legitimate_constant_p): ...this. Make static. Add a mode argument. (ix86_cannot_force_const_mem): Update accordingly. (ix86_legitimate_address_p): Likewise. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/i386/i386.md: Update commentary. * config/ia64/ia64-protos.h (ia64_legitimate_constant_p): Delete. * config/ia64/ia64.h (LEGITIMATE_CONSTANT_P): Likewise. * config/ia64/ia64.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (ia64_legitimate_constant_p): Make static. Add a mode argument. * config/iq2000/iq2000.h (LEGITIMATE_CONSTANT_P): Delete. * config/lm32/lm32-protos.h (lm32_legitimate_constant_p): Delete. * config/lm32/lm32.h (LEGITIMATE_CONSTANT_P): Likewise. * config/lm32/lm32.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (lm32_legitimate_constant_p): Make static. Add a mode argument. * config/m32c/m32c-protos.h (m32c_legitimate_constant_p): Delete. * config/m32c/m32c.h (LEGITIMATE_CONSTANT_P): Likewise. * config/m32c/m32c.c (m32c_legitimate_constant_p): Likewise. * config/m32r/m32r.h (LEGITIMATE_CONSTANT_P): Delete. * config/m32r/m32r.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (m32r_legitimate_constant_p): New function. * config/m68k/m68k-protos.h (m68k_legitimate_constant_p): Declare. * config/m68k/m68k.h (CONSTANT_ADDRESS_P): Call it instead of LEGITIMATE_CONSTANT_P. (LEGITIMATE_CONSTANT_P): Delete. * config/m68k/m68k.c (m68k_expand_prologue): Call m68k_legitimate_constant_p instead of LEGITIMATE_CONSTANT_P. (m68k_legitimate_constant_p): New function. * config/m68k/m68k.md: Update comments. * config/mcore/mcore.h (LEGITIMATE_CONSTANT_P): Delete. * config/mcore/mcore.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mcore_legitimate_constant_p): New function. * config/mep/mep-protos.h (mep_legitimate_constant_p): Delete. * config/mep/mep.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mep/mep.c (mep_legitimate_constant_p): Make static. Add a mode argument. (mep_legitimate_address): Update accordingly. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/microblaze/microblaze-protos.h (microblaze_const_double_ok): Delete. * config/microblaze/microblaze.h (LEGITIMATE_CONSTANT_P): Likewise. * config/microblaze/microblaze.c (microblaze_const_double_ok): Make static. Check OP's mode for VOIDmode. (microblaze_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/mips.h (LEGITIMATE_CONSTANT_P): Delete. * config/mips/mips.c (mips_legitimate_constant_p): New function. (mips_cannot_force_const_mem): Use it instead of LEGITIMATE_CONSTANT_P. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/predicates.md: Update comments. * config/mmix/mmix-protos.h (mmix_legitimate_constant_p): Delete. * config/mmix/mmix.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mmix/mmix.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mmix_legitimate_constant_p): Make static, return a bool, and take a mode argument. (mmix_print_operand_address): Update accordingly. * config/mn10300/mn10300-protos.h (mn10300_legitimate_constant_p): Delete. * config/mn10300/mn10300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mn10300/mn10300.c (mn10300_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/moxie/moxie.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pa_legitimate_constant_p): New function. * config/picochip/picochip.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pdp11_legitimate_constant_p): New function. * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Delete. * config/rs6000/rs6000.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (rs6000_legitimate_constant_p): New function. * config/rx/rx-protos.h (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. * config/rx/rx.h (LEGITIMATE_CONSTANT_P): Delete. * config/rx/rx.c (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/rx/rx.md (mov<register_modes:mode>): Update accordingly. * config/s390/s390-protos.h (legitimate_constant_p): Delete. * config/s390/s390.h (LEGITIMATE_CONSTANT_P): Likewise. * config/s390/s390.c (legitimate_constant_p): Rename to... (s390_legitimate_constant_p): ...this. Make static, return a bool, and add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/score/score.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (sh_legitimate_constant_p): New function. * config/sparc/sparc-protos.h (legitimate_constant_p): Delete. * config/sparc/sparc.h (LEGITIMATE_CONSTANT_P): Delete. * config/sparc/sparc.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (legitimate_constant_p): Rename to... (sparc_legitimate_constant_p): ...this. Make static. Add a mode argument. (constant_address_p): Update accordingly. * config/spu/spu-protos.h (spu_legitimate_constant_p): Add a mode argument and return a bool. * config/spu/spu.h (LEGITIMATE_CONSTANT_P): Delete. * config/spu/spu.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (spu_legitimate_constant_p): Add a mode argument and return a bool. (spu_rtx_costs): Update accordingly. * config/spu/predicates.md (vec_imm_operand): Likewise. * config/stormy16/stormy16.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.c (v850_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/vax/vax-protos.h (legitimate_constant_p): Delete. * config/vax/vax.h (LEGITIMATE_CONSTANT_P): Likewise. * config/vax/vax.c (legitimate_constant_p): Likewise. * config/xtensa/xtensa.h (LEGITIMATE_CONSTANT_P): Delete. * config/xtensa/xtensa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (xtensa_legitimate_constant_p): New function. From-SVN: r172814
2011-04-20Makefile.in (INTERNAL_FN_DEF, [...]): Define.Richard Sandiford1-3/+6
gcc/ * Makefile.in (INTERNAL_FN_DEF, INTERNAL_FN_H): Define. (GIMPLE_H): Include $(INTERNAL_FN_H). (OBJS-common): Add internal-fn.o. (internal-fn.o): New rule. * internal-fn.def: New file. * internal-fn.h: Likewise. * internal-fn.c: Likewise. * gimple.h: Include internal-fn.h. (GF_CALL_INTERNAL): New gf_mask. (gimple_statement_call): Put fntype into a union with a new internal_fn field. (gimple_build_call_internal): Declare. (gimple_build_call_internal_vec): Likewise. (gimple_call_same_target_p): Likewise. (gimple_call_internal_p): New function. (gimple_call_internal_fn): Likewise. (gimple_call_fntype): Return null for internal calls. (gimple_call_set_fntype): Assert that the function is not internal. (gimple_call_set_fn): Likewise. (gimple_call_set_fndecl): Likewise. (gimple_call_set_internal_fn): New function. (gimple_call_addr_fndecl): Handle null functions. (gimple_call_return_type): Likewise null types. * gimple.c (gimple_build_call_internal_1): New function. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_call_same_target_p): Likewise. (gimple_call_flags): Handle calls to internal functions. (gimple_call_fnspec): New function. (gimple_call_arg_flags, gimple_call_return_flags): Use it. (gimple_has_side_effects): Handle null functions. (gimple_rhs_has_side_effects): Likewise. (gimple_call_copy_skip_args): Handle calls to internal functions. * cfgexpand.c (expand_call_stmt): Likewise. * expr.c (expand_expr_real_1): Assert that the call isn't internal. * gimple-fold.c (gimple_fold_call): Handle null functions. (gimple_fold_stmt_to_constant_1): Don't fold calls to internal functions. * gimple-low.c (gimple_check_call_args): Handle calls to internal functions. * gimple-pretty-print.c (dump_gimple_call): Likewise. * ipa-prop.c (ipa_analyze_call_uses): Handle null functions. * tree-cfg.c (verify_gimple_call): Handle calls to internal functions. (do_warn_unused_result): Likewise. * tree-eh.c (same_handler_p): Use gimple_call_same_target_p. * tree-ssa-ccp.c (ccp_fold_stmt): Handle calls to internal functions. * tree-ssa-dom.c (hashable_expr): Use the gimple statement to record the target of a call. (initialize_hash_element): Update accordingly. (hashable_expr_equal_p): Use gimple_call_same_target_p. (iterative_hash_hashable_expr): Handle calls to internal functions. (print_expr_hash_elt): Likewise. * tree-ssa-pre.c (can_value_number_call): Likewise. (eliminate): Handle null functions. * tree-ssa-sccvn.c (visit_use): Handle calls to internal functions. * tree-ssa-structalias.c (get_fi_for_callee): Likewise. (find_func_aliases): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_indirect_call_to_profile): Likewise. * lto-streamer-in.c (input_gimple_stmt): Likewise. * lto-streamer-out.c (output_gimple_stmt): Likewise. From-SVN: r172758
2011-04-18expr.c (expand_expr_real_2): Use GET_MODE instead of TYPE_MODE.Michael Matz1-1/+4
2011-05-18 Michael Matz <matz@suse.de> Steve Ellcey <sje@cup.hp.com> * expr.c (expand_expr_real_2): Use GET_MODE instead of TYPE_MODE. Co-Authored-By: Steve Ellcey <sje@cup.hp.com> From-SVN: r172673
2011-04-09expr.c (expand_expr_real_1): Use add_to_hard_reg_set function instead of loop.Anatoly Sokolov1-12/+5
* expr.c (expand_expr_real_1): Use add_to_hard_reg_set function instead of loop. * sel-sched.c (mark_unavailable_hard_regs): Likewise. * function.c (record_hard_reg_sets): Likewise. * ira.c (compute_regs_asm_clobbered): Likewise. * sched-deps.c (sched_analyze_1): Likewise. * reload1.c (mark_reload_reg_in_use, choose_reload_regs): Likewise. From-SVN: r172231
2011-04-08gimple.h (gimple_call_fntype): New function.Richard Guenther1-2/+1
2011-04-08 Richard Guenther <rguenther@suse.de> * gimple.h (gimple_call_fntype): New function. (gimple_call_return_type): Use it. * expr.c (expand_expr_real_1): Use gimple_call_fntype. * gimple-low.c (gimple_check_call_args): Likewise. * gimple.c (gimple_call_flags): Likewise. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. * tree-cfg.c (verify_gimple_call): Likewise. (do_warn_unused_result): Likewise. * tree-ssa-ccp.c (ccp_fold_stmt): Likewise. * value-prof.c (gimple_ic_transform): Fix fndecl check. From-SVN: r172178
2011-04-01re PR middle-end/48335 (ICE in convert_move)Jakub Jelinek1-6/+37
PR middle-end/48335 * expr.c (expand_assignment): Handle all possibilities if TO_RTX is CONCAT. * expmed.c (store_bit_field_1): Avoid trying to create invalid SUBREGs. (store_split_bit_field): If SUBREG_REG (op0) or op0 itself has smaller mode than word, return it for offset 0 and const0_rtx for out-of-bounds stores. If word is const0_rtx, skip it. * gcc.c-torture/compile/pr48335-1.c: New test. * gcc.dg/pr48335-1.c: New test. * gcc.dg/pr48335-2.c: New test. * gcc.dg/pr48335-3.c: New test. * gcc.dg/pr48335-4.c: New test. * gcc.dg/pr48335-5.c: New test. * gcc.dg/pr48335-6.c: New test. * gcc.dg/pr48335-7.c: New test. * gcc.dg/pr48335-8.c: New test. * gcc.target/i386/pr48335-1.c: New test. From-SVN: r171855
2011-04-01expr.c (emit_block_move_via_movmem): Use n_generator_args instead of n_operands.Richard Sandiford1-10/+4
gcc/ * expr.c (emit_block_move_via_movmem): Use n_generator_args instead of n_operands. (set_storage_via_setmem): Likewise. * optabs.c (maybe_gen_insn): Likewise. * config/arm/arm.c (arm_init_neon_builtins): Likewise. * config/mips/mips.c (mips_expand_builtin_compare_1): Likewise. (mips_expand_builtin_direct): Likewise. * config/spu/spu.c (expand_builtin_args): Likewise. From-SVN: r171823
2011-03-31tree-ssa-forwprop.c (forward_propagate_into_cond): Avoid typo potentially ↵Jeff Law1-6/+2
leading to null pointer dereference. * tree-ssa-forwprop.c (forward_propagate_into_cond): Avoid typo potentially leading to null pointer dereference. * caller-save.c (new_saved_hard_reg): Eliminate return value. (setup_save_areas): Corresponding changes to avoid useless assignments. * jump.c (reversed_comparison_code_parts): Avoid successive return statements when REVERSE_CONDITION is defined. * expr.c (expand_assignment): Avoid useless assignments. (expand_expr_real_1): Likewise. (expand_expr_real_2): Avoid useless statements. * tree-ssa-phiopt.c (minmax_replacement): Avoid useless statement. * cfgexpand.c (expand_gimple_basic_block): Avoid useless assignment. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Avoid useless statements. * stmt.c (expand_expr_stmt): Avoid useless assignment. From-SVN: r171780
2011-03-25expr.c (emit_block_move_via_movmem): Only use 6 operand variant if there are ↵Richard Henderson1-4/+12
exactly 6 operands. * expr.c (emit_block_move_via_movmem): Only use 6 operand variant if there are exactly 6 operands. (set_storage_via_setmem): Similarly. From-SVN: r171532
2011-03-23expr.c (expand_expr_real_1): Only use BLKmode for volatile accesses which ↵Julian Brown1-2/+5
are not naturally aligned. * expr.c (expand_expr_real_1): Only use BLKmode for volatile accesses which are not naturally aligned. From-SVN: r171347
2011-03-23optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to ↵Richard Sandiford1-131/+61
"enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-22gimple.c (gimple_rhs_class_table): POLYNOMIAL_CHREC is not a valid RHS.Richard Guenther1-31/+30
2011-03-22 Richard Guenther <rguenther@suse.de> * gimple.c (gimple_rhs_class_table): POLYNOMIAL_CHREC is not a valid RHS. Make DOT_PROD_EXPR and REALIGN_LOAD_EXPR ternary. * tree-cfg.c (verify_gimple_assign_ternary): Allow DOT_PROD_EXPR and REALIGN_LOAD_EXPR. (verify_gimple_assign_single): Do not allow POLYNOMIAL_CHREC, DOT_PROD_EXPR or REALIGN_LOAD_EXPR. * expr.c (expand_expr_real_1): Move REALIGN_LOAD_EXPR and DOT_PROD_EXPR case ... (expand_expr_real_2): ... here. * gimple-pretty-print.c (dump_ternary_rhs): Handle DOT_PROD_EXPR and REALIGN_LOAD_EXPR. * tree-data-ref.c (split_constant_offset): Bail out for all CHRECs. * tree-vect-loop.c (vect_model_reduction_cost): Handle ternaries. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Likewise. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Adjust. * tree-vect-stmts.c (vectorizable_load): Likewise. From-SVN: r171284
2011-03-21expr.h (prepare_operand): Move to...Richard Sandiford1-2/+2
gcc/ 2011-03-21 Richard Sandiford <richard.sandiford@linaro.org> * expr.h (prepare_operand): Move to... * optabs.h (prepare_operand): ...here and change the insn code parameter from "int" to "enum insn_code". (insn_operand_matches): Declare. * expr.c (init_expr_target): Use insn_operand_matches. (compress_float_constant): Likewise. * function.c (safe_insn_predicate, assign_parm_setup_reg): Likewise. * optabs.c (can_compare_p, prepare_cmp_insn): Likewise. (emit_cmp_and_jump_insn_1, gen_add2_insn, gen_add3_insn): Likewise. (have_add2_insn, gen_sub2_insn, gen_sub3_insn, have_sub2_insn): Likewise. (gen_cond_trap): Likewise. (prepare_operand): Likewise. Change icode to an insn_code. (insn_operand_matches): New function. * reload.c (find_reloads_address_1): Use insn_operand_matches. * reload1.c (gen_reload): Likewise. * targhooks.c (default_secondary_reload): Likewise. From-SVN: r171270
2011-03-18re PR middle-end/47790 (optimize_bitfield_assignment_op no longer works in ↵Andrew Pinski1-8/+34
4.5.x) PR middle-end/47790 * expr.c (optimize_bitfield_assignment_op): Revamp to work again after expansion changes. From-SVN: r171139
2011-03-18re PR bootstrap/48161 (hppa*-*-* will not bootstrap on 4.6 branch with ↵Jakub Jelinek1-1/+1
release checking) PR bootstrap/48161 * expr.c (expand_expr_addr_expr_1): Use simplify_gen_binary instead of gen_rtx_PLUS if EXPAND_SUM or EXPAND_INITIALIZER. * gcc.c-torture/compile/pr48161.c: New test. From-SVN: r171126
2011-03-09re PR rtl-optimization/47866 (gcc.dg/torture/vector-2.c fails on IA64)Jakub Jelinek1-1/+2
PR rtl-optimization/47866 * expr.c (store_field): If MEM_SCALAR_P (target), don't use MEM_SET_IN_STRUCT_P (to_rtx, 1), just set MEM_IN_STRUCT_P (to_rtx) if target wasn't scalar. * function.c (assign_stack_temp_for_type): Assert that neither MEM_SCALAR_P nor MEM_IN_STRUCT_P is set previously, set either MEM_IN_STRUCT_P or MEM_SCALAR_P instead of using MEM_SET_IN_STRUCT_P macro. * rtl.h (MEM_SET_IN_STRUCT_P): Removed. From-SVN: r170834
2011-02-04re PR inline-asm/23200 (rejects "i"(&var + 1))Jakub Jelinek1-0/+7
PR inline-asm/23200 * tree-ssa-ter.c (is_replaceable_p): Add TER argument. Don't do bb, locus and block comparison and disallow loads if it is not set. (stmt_is_replaceable_p): New function. (process_replaceable, find_replaceable_in_bb): Adjust is_replaceable_p callers. * expr.c (expand_expr_real_1) <case SSA_NAME>: If get_gimple_for_ssa_name try for EXPAND_INITIALIZER harder to use SSA_NAME_DEF_STMT. * tree-flow.h (stmt_is_replaceable_p): New prototype. * gcc.dg/pr23200.c: New test. From-SVN: r169831
2011-02-03re PR target/47312 (ICE: in expand_ternary_op, at optabs.c:656 with -flto ↵Jakub Jelinek1-0/+12
-mno-sse -mxop and __builtin_fmaf()) PR target/47312 * expr.c (expand_expr_real_2) <case FMA_EXPR>: If target doesn't expand fma, expand FMA_EXPR as fma{,f,l} call. * gcc.target/i386/pr47312.c: New test. From-SVN: r169786
2011-01-28re PR target/42894 (Invalid rtl sharing in Thumb1.)Jakub Jelinek1-1/+1
PR target/42894 * varasm.c (force_const_mem): Store copy of x in desc->constant instead of x itself. * expr.c (emit_move_insn): Add a copy of y_cst instead of y_cst itself into REG_EQUAL note. * gcc.dg/tls/pr42894.c: New test. From-SVN: r169370
2011-01-18re PR rtl-optimization/47299 (Widening multiply optimization generates bad code)Jakub Jelinek1-4/+5
PR rtl-optimization/47299 * expr.c (expand_expr_real_2) <case WIDEN_MULT_EXPR>: Don't use subtarget. Use normal multiplication if both operands are constants. * expmed.c (expand_widening_mult): Don't try to optimize constant multiplication if op0 has VOIDmode. Convert op1 constant to mode before using it. * gcc.c-torture/execute/pr47299.c: New test. From-SVN: r168944
2011-01-03re PR middle-end/47017 (gnatlib ICE on sparc64-linux)Eric Botcazou1-1/+1
PR middle-end/47017 * expr.c (expand_expr_real_1) <MEM_REF>: Call memory_address_addr_space instead of convert_memory_address_addr_space on the base expression. From-SVN: r168447
2010-12-21re PR middle-end/45852 (volatile structs are broken!)Jakub Jelinek1-1/+4
PR middle-end/45852 * expr.c (store_expr): Ignore alt_rtl if equal to target, but has side-effects. * gcc.target/i386/pr45852.c: New test. From-SVN: r168105
2010-11-25target.def (supports_split_stack, [...]): Take gcc_options parameters.Joseph Myers1-1/+1
* target.def (supports_split_stack, except_unwind_info): Take gcc_options parameters. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Take gcc_options parameters. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Update prototypes. * doc/tm.texi.in (TARGET_IRA_COVER_CLASSES, TARGET_HAVE_NAMED_SECTIONS, TARGET_UNWIND_TABLES_DEFAULT): Document that hooks must not be modified. (TARGET_EXCEPT_UNWIND_INFO): Refer to opts argument. * doc/tm.texi: Regenerate. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Pass &global_options to targetm.except_unwind_info. * dwarf2out.c (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Pass &global_options to targetm.except_unwind_info. * except.c (init_eh, finish_eh_generation, gate_convert_to_eh_region_ranges, output_one_function_exception_table): Pass &global_options to targetm.except_unwind_info. * expr.c (build_personality_function): Pass &global_options to targetm.except_unwind_info. * function.c (expand_function_end): Pass &global_options to targetm.except_unwind_info. * hooks.c (hook_bool_bool_gcc_optionsp_false): New. * hooks.h (hook_bool_bool_gcc_optionsp_false): Declare. * opts.c (finish_options): Pass opts to targetm.except_unwind_info and targetm.supports_split_stack. Remove assertions about opts and opts_set. (common_handle_option): Remove assertions about opts, opts_set and dc. * tree-tailcall.c (suitable_for_tail_call_opt_p): Pass &global_options to targetm.except_unwind_info. * tree.c (build_common_builtin_nodes: Pass &global_options to targetm.except_unwind_info. * config/arm/arm.c (arm_except_unwind_info): Add gcc_options parameter. (arm_compute_func_type, arm_expand_prologue, thumb_pushpop, thumb1_expand_prologue, thumb1_output_function_prologue, arm_unwind_emit, arm_output_fn_unwind): Update calls to arm_except_unwind_info. * config/i386/i386.c (ix86_supports_split_stack): Add gcc_options parameter. * config/ia64/ia64.c (ia64_except_unwind_info): Add gcc_options parameter. (ia64_output_function_prologue, ia64_add_bundle_selector_before, ia64_reorg, ia64_asm_unwind_emit): Update calls to ia64_except_unwind_info. * config/pa/pa.c (pa_option_override): Pass &global_options to targetm.except_unwind_info. * config/picochip/picochip-protos.h (picochip_except_unwind_info): Remove prototype. c-family: * c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to targetm.except_unwind_info. From-SVN: r167145
2010-11-16expr.c (alignment_for_piecewise_move): New function.Nathan Froyd1-96/+64
* expr.c (alignment_for_piecewise_move): New function. (widest_int_mode_for_size): New function. (move_by_pieces, move_by_pieces_ninsns): Call them. (can_store_by_pieces, store_by_pieces_1): Likewise. From-SVN: r166802
2010-11-11re PR middle-end/46388 (ICE in int_mode_for_mode, at stor-layout.c:493)Jakub Jelinek1-10/+20
PR middle-end/46388 * expr.c (expand_assignment): If to_rtx is a VOIDmode MEM, use BLKmode mode for it. (expand_expr_real_1): Similarly for op0. * gcc.c-torture/compile/pr46388.c: New test. From-SVN: r166603
2010-11-05re PR target/45670 (Less efficient x86 addressing mode selection on 4.6, ↵Jakub Jelinek1-1/+1
causes -Os size regression from 4.5) PR target/45670 * expr.c (expand_expr_real_1) <case MEM_REF>: Use EXPAND_SUM instead of EXPAND_NORMAL for base expansion. * gcc.target/i386/pr45670.c: New test. From-SVN: r166371
2010-11-05re PR bootstrap/44756 ([meta-bug] --enable-werror-always issues)Joern Rennecke1-1/+2
PR bootstrap/44756 * expr.c (can_store_by_pieces): Add ATTRIBUTE_UNUSED to cst. * haifa-sched.c (initiate_bb_reg_pressure_info): Add ATTRIBUTE_UNUSED to i. From-SVN: r166366
2010-11-05re PR bootstrap/44756 ([meta-bug] --enable-werror-always issues)Joern Rennecke1-1/+1
PR bootstrap/44756 * expr.c (emit_push_insn): Cast value of PUSH_ROUNDING before comparing it to a signed value. From-SVN: r166360
2010-11-04tree.def (FMA_EXPR): New tree code.Richard Guenther1-2/+43
2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-10-22expr.c (emit_group_load_1): Update calls to extract_bit_field.Jie Zhang1-6/+12
* expr.c (emit_group_load_1): Update calls to extract_bit_field. (copy_blkmode_from_reg): Likewise. (read_complex_part): Likewise. (expand_expr_real_1): Calculate packedp and pass it to extract_bit_field. * expr.h (extract_bit_field): Update declaration. * calls.c (store_unaligned_arguments_into_pseudos): Update call to extract_bit_field. * expmed.c (extract_fixed_bit_field): Update calls to extract_fixed_bit_field. (store_split_bit_field): Likewise. (extract_bit_field_1): Add new argument packedp. (extract_bit_field): Add new argument packedp. (extract_fixed_bit_field): Add new argument packedp and let packed attribute override volatile. * stmt.c (expand_return): Update call to extract_bit_field. From-SVN: r165799
2010-10-13Centralize knowledge of eh personality routines.Richard Henderson1-3/+21
From-SVN: r165433
2010-10-12expr.c (store_expr): Share code for STRING_CST and MEM_REF of &STRING_CST cases.Jakub Jelinek1-49/+15
* expr.c (store_expr): Share code for STRING_CST and MEM_REF of &STRING_CST cases. Don't require BLKmode, instead check if target is a MEM. From-SVN: r165360
2010-10-08lto-streamer-in.c (lto_input_ts_decl_minimal_tree_pointers): Re-construct ↵Richard Guenther1-0/+1
BLOCK_VARS. 2010-10-08 Richard Guenther <rguenther@suse.de> * lto-streamer-in.c (lto_input_ts_decl_minimal_tree_pointers): Re-construct BLOCK_VARS. (lto_input_ts_block_tree_pointers): Do not stream BLOCK_VARS. * lto-streamer-out.c (lto_output_ts_block_tree_pointers): Likewise. * tree.c (free_lang_data_in_block): Remove. (free_lang_data_in_decl): Do not touch DECL_CONTEXT of non-PARM_DECLs. Do not touch the BLOCK tree. * expr.c (expand_expr_real_1): Allow externals. From-SVN: r165191
2010-10-04expr.c (expand_assignment): Add assertion to prevent emitting null rtx for ↵Julian Brown1-0/+4
movmisalign pattern. gcc/ * expr.c (expand_assignment): Add assertion to prevent emitting null rtx for movmisalign pattern. (expand_expr_real_1): Likewise. * config/arm/arm.c (arm_builtin_support_vector_misalignment): New. (TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT): New. Use above. (arm_vector_alignment_reachable): New. (TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE): New. Use above. (neon_vector_mem_operand): Disallow PRE_DEC for misaligned loads. (arm_print_operand): Include alignment qualifier in %A. * config/arm/neon.md (UNSPEC_MISALIGNED_ACCESS): New constant. (movmisalign<mode>): New expander. (movmisalign<mode>_neon_store, movmisalign<mode>_neon_load): New insn patterns. gcc/testsuite/ * gcc.dg/vect/vect-42.c: Use vect_element_align instead of vect_hw_misalign. * gcc.dg/vect/vect-60.c: Likewise. * gcc.dg/vect/vect-56.c: Likewise. * gcc.dg/vect/vect-93.c: Likewise. * gcc.dg/vect/no-scevccp-outer-8.c: Likewise. * gcc.dg/vect/vect-95.c: Likewise. * gcc.dg/vect/vect-96.c: Likewise. * gcc.dg/vect/vect-outer-5.c: Use quad-word vectors when available. * gcc.dg/vect/slp-25.c: Likewise. * gcc.dg/vect/slp-3.c: Likewise. * gcc.dg/vect/vect-multitypes-1.c: Likewise. * gcc.dg/vect/no-vfa-pr29145.c: Likewise. * gcc.dg/vect/vect-multitypes-4.c: Likewise. Use vect_element_align. * gcc.dg/vect/vect-109.c: Likewise. * gcc.dg/vect/vect-peel-1.c: Likewise. * gcc.dg/vect/vect-peel-2.c: Likewise. * lib/target-supports.exp (check_effective_target_arm_vect_no_misalign): New. (check_effective_target_vect_no_align): Use above. (check_effective_target_vect_element_align): New. (add_options_for_quad_vectors): New. From-SVN: r164941
2010-09-24lto-symtab.c (lto_symtab_entry_def): Add guessed field.Jan Hubicka1-1/+1
* lto-symtab.c (lto_symtab_entry_def): Add guessed field. (lto_symtab_resolve_symbols): Set it. (lto_symtab_merge_decls_1): Do not compute used_from_object_file; store resolution field in cgraph/varpool. * cgraph.c (cgraph_same_body_alias, cgraph_add_thunk): Return node. (cgraph_get_node_or_alias, cgraph_get_node_or_alias): Constify. (cgraph_dump_node): Drop used_from_object_file. (cgraph_clone_node, cgraph_create_virtual_clone): Likewise. (cgraph_function_body_availability): Use decl_replaceable_p. (cgraph_make_node_local): Set resolution to LDPR_PREVAILING_DEF_IRONLY. (cgraph_can_remove_if_no_direct_calls_and_refs): Use cgraph_used_from_object_file_p. (cgraph_will_be_removed_from_program_if_no_direct_calls): Use cgraph_used_from_object_file_p. (resolution_used_from_other_file_p): New functoin. (cgraph_used_from_object_file_p): New predicate. * cgraph.h: Include plugin-api.h (struct cgraph_local_info): Remove used_from_object_file. (struct cgraph_node): Add resolution field. (struct varpool_node): Likewise; remove used_from_object_file; reove const_value_known. (cgraph_get_node, cgraph_get_node_or_alias, cgraph_node, cgraph_same_body_alias, cgraph_add_thunk): Update prototypes. (resolution_used_from_other_file_p, cgraph_used_from_object_file_p, varpool_used_from_object_file_p): Declare. (varpool_get_node, varpool_extra_name_alias): Update prototype. * tree.h (DECL_REPLACEABLE_P): Remove. (decl_replaceable_p, decl_binds_to_current_def_p): Declare. * final.c (rest_of_clean_state): Use decl_binds_to_current_def_p. * lto-cgraph.c (lto_output_node, lto_output_varpool_node, input_overwrite_node, input_node, input_varpool_node): Stream resolution. * expr.c (expand_expr_real_1): Use const_value_known_p * ipa.c (ipa_discover_readonly_nonaddressable_var): Do not set const_value_known. (cgraph_externally_visible_p): Use cgraph_used_from_object_file_p. (function_and_variable_visibility): Set resolution for local vars and functions. use varpool_used_from_object_file_p. * varasm.c (resolution_to_local_definition_p, resolution_local_p): New static functions. (default_binds_local_p_1): Use resolutoin info. (decl_binds_to_current_def_p, decl_replaceable_p): New functions. * varpool.c (varpool_get_node): Constify. (const_value_known_p): Do not use vnode->const_value_known; use decl_replaceable_p. (varpool_finalize_decl): Do not set const_value_known. (cgraph_variable_initializer_availability): Use decl_replaceable_p (varpool_extra_name_alias): Return new node. (varpool_used_from_object_file_p): New function. * decl.c (finish_function): Use decl_replaceable_p * method.c (make_alias_for_thunk): Update call of cgraph_same_body_alias. * lto.c (lto_promote_cross_file_statics): Use const_value_known_p. From-SVN: r164610
2010-09-24re PR middle-end/45738 (ICE: tree check: expected var_decl, have ↵Jan Hubicka1-1/+3
debug_expr_decl in const_value_known_p, at varpool.c:375) PR tree-optimization/45738 PR tree-optimization/45741 * expr.c (string_constant): Allow CONST_DECL too; check that DECL_INITIAL is set. * varpool.c (const_value_known_p): Only look into VAR_DECL and CONST_DECL. * gcc.c-torture/compile/pr45741.c: New. * gfortran.fortran-torture/compile/pr45738.f90: New. From-SVN: r164602
2010-09-20re PR rtl-optimization/45728 (ICE: in gen_lowpart_general, at rtlhooks.c:59 ↵Jakub Jelinek1-1/+9
at -O1 when comparing union members) PR rtl-optimization/45728 * expr.c (expand_expr_real_1): If op0 isn't REG or MEM, try gen_lowpart_common first and if that fails, force_reg first before calling gen_lowpart. * gcc.c-torture/compile/pr45728.c: New test. From-SVN: r164456
2010-09-20re PR tree-optimization/45605 (Missed devirtualization)Jan Hubicka1-7/+1
PR tree-optimize/45605 * cgraph.h (const_value_known_p): Declare. (varpool_decide_const_value_known): Remove. * tree-ssa-ccp.c (get_base_constructor): Use it. * lto-cgraph.c (compute_ltrans_boundary): Likewise. * expr.c (string_constant): Likewise. * tree-ssa-loop-ivcanon.c (constant_after_peeling): Likewise. * ipa.c (ipa_discover_readonly_nonaddressable_var, function_and_variable_visibility): Likewise. * gimplify.c (gimplify_call_expr): Likewise. * gimple-fold.c (get_symbol_constant_value): Likewise. * varpool.c (varpool_decide_const_value_known): Replace by... (const_value_known_p): ... this one; handle other kinds of DECLs too and work for automatic vars. (varpool_finalize_decl): Use const_value_known_p. * lto.c (lto_promote_cross_file_statics): Use const_value_known_p. * g++.dg/tree-ssa/pr45605.C: New testcase. From-SVN: r164438
2010-09-15re PR tree-optimization/45633 (internal compiler error: verify_stmts failed)Jakub Jelinek1-0/+19
PR tree-optimization/45633 * tree-cfg.c (verify_gimple_assign_binary): Allow MINUS_EXPR with lhs and rhs1 pointer vector and rhs2 sizetype vector. * expr.c (expand_expr_real_2) <case PLUS_EXPR>: For pointer or vector pointer use TER to optimize pointer subtraction. * gcc.dg/vect/pr45633.c: New test. From-SVN: r164312
2010-09-06tree.def (MISALIGNED_INDIRECT_REF): Remove.Richard Guenther1-86/+107
2010-09-06 Richard Guenther <rguenther@suse.de> * tree.def (MISALIGNED_INDIRECT_REF): Remove. * tree.h (INDIRECT_REF_P): Only check for INDIRECT_REF. (build_aligned_type): Declare. * tree.c (check_qualified_type): Also compare TYPE_ALIGN. (check_aligned_type): New function. (build_aligned_type): Likewise. * expr.c (expand_assignment): Handle misaligned stores via TARGET_MEM_REF and MEM_REF using movmisalign_optab. (expand_expr_real_1): Likewise. (safe_from_p): Remove MISALIGNED_INDIRECT_REF handling. * tree-vect-stmts.c (vectorizable_store): Do not build MISALIGNED_INDIRECT_REF but initialize alignment information. (vectorizable_load): Likewise. * builtins.c (get_object_alignment): Remove MISALIGNED_INDIRECT_REF handling. * cfgexpand.c (expand_debug_expr): Likewise. * dwarf2out.c (loc_list_from_tree): Likewise. * fold-const.c (maybe_lvalue_p): Likewise. (operand_equal_p): Likewise. (build_fold_addr_expr_with_type_loc): Likewise. * gimplify.c (gimplify_addr_expr): Likewise. (gimplify_expr): Likewise. * tree-cfg.c (verify_types_in_gimple_min_lval): Likewise. (verify_gimple_assign_single): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. (tree_could_trap_p): Likewise. * tree-predcom.c (ref_at_iteration): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. (op_code_prio): Likewise. (op_symbol_code): Likewise. * tree-ssa-ccp.c (get_value_from_alignment): Likewise. * tree-ssa-loop-im.c (for_each_index): Likewise. (gen_lsm_tmp_name): Likewise. * tree-ssa-loop-ivopts.c (idx_find_step): Likewise. (find_interesting_uses_address): Likewise. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise. (ao_ref_init_from_vn_reference): Likewise. * tree.c (staticp): Likewise. (build1_stat): Likewise. (reference_alias_ptr_type): Likewise. * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. * config/rs6000/rs6000.c (rs6000_check_sdmode): Remove MISALIGNED_INDIRECT_REF handling. From-SVN: r163915