summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
Commit message (Collapse)AuthorAgeFilesLines
* gcc/rsandifo2008-11-111-18/+0
| | | | | | | | | PR rtl-optimization/37363 * simplify-rtx.c (simplify_plus_minus): Don't create (const (minus ...)) expresisons. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141774 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/rsandifo2008-09-021-2/+6
| | | | | | | | | * simplify-rtx.c (simplify_binary_operation_1): Check for CONST, SYMBOL_REF and LABEL_REF when applying plus_constant, instead of checking for a non-VOID CONSTANT_P. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139903 138bc75d-0d04-0410-961f-82ee72b054a4
* * fwprop.c (should_replace_address): Add speed attribute.hubicka2008-08-311-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (PR_OPTIMIZE_FOR_SPEED): New flag. (propagate_rtx_1): Use it. (propagate_rtx): Set it. (try_fwprop_subst): Update call of rtx_costs. (forward_propagate_and_simplify): LIkewise. * hooks.c (hook_int_rtx_bool_0): New (hook_bool_rtx_int_int_intp_false): Replace by ... (hook_bool_rtx_int_int_intp_bool_false): .. thisone. * hooks.h (hook_int_rtx_bool_0): New (hook_bool_rtx_int_int_intp_false): Replace by ... (hook_bool_rtx_int_int_intp_bool_false): .. thisone. * optabs.c (avoid_expensive_constant): UPdate call of rtx_cost. (prepare_cmp_insn): UPdate call of rtx_cost. * postreload.c (reload_cse_simplify_set): Update call of rtx_cost. (reload_cse_simplify_operands): Update call of rtx_cost. (reload_cse_move2add): call of rtx_cost. * target.h (struct gcc_target): Update rtx_costs and address_costs. * rtlanal.c (rtx_cost): Add speed argument. (address_cost): Add speed argument (default_address_cost): Likewise. (insn_rtx_cost): Likewise. * cfgloopanal.c (seq_cost): Add speed argument. (target_reg_cost, target_spill_cost): Turn to array. (init_set_costs): Update for speed. (estimate_reg_pressure_cost): Add speed argument. * auto-inc-dec.c (attempt_change): Update call of rtx_cost. * dojump.c (prefer_and_bit_test): UPdate call of rtx_cost. * tree-ssa-loop-ivopts.c (struct ivopts_data): New field speed. (seq_cost): Add speed argument. (computation_cost): Add speed arugment. (add_cost, multiply_by_const, get_address_cost): add speed argument. (force_expr_to_var_cost): Update for profile info. (force_var_cost): Likewise. (split_address_cost): Likewise. (ptr_difference_cost): Likewise. (difference_cost): Likewise. (get_computation_cost_at): Likewise. (determine_iv_cost): Likewise. (ivopts_global_cost_for_size): Likewise. (rewrite_use_address): Likewise. (tree_ssa_iv_optimize_loop): Initialize speed field. * cse.c (optimize_this_for_speed_p): New static var. (notreg_cost): Update call of rtx_cost. (cse_extended_basic_block): set optimize_this_for_speed_p. * ifcvt.c (cheap_bb_rtx_cost_p): Update call of rtx_cost. (noce_try_cmove_arith): Likewise. (noce_try_sign_mask): LIkewise. * expr.c (compress_float_constant): Update rtx_cost calls. * tree-ssa-address.c (most_expensive_mult_to_index): Add speed argument. (addr_to_parts): Likewise. (create_mem_ref): Likewise. * dse.c (find_shift_sequence): Add speed argument. (replace_read): Update call. * calls.c (precompute_register_parameters): Update call of rtx_cost. * expmed.c (sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost, * neg_cost, shift_cost, shiftadd_cost, shiftsub_cost, mul_cost, sdiv_cost, udiv_cost ,mul_widen_cost, mul_highpart_cost): Increase dimension. (init_expmed): Initialize for both size and speed. (expand_shift): Use profile. (synth_mult): Use profile. (choose_mult_variant): Use profile. (expand_mult): Use profile. (expand_mult_highpart_optab): Use profile. (expand_mult_highpart): Use profile. (expand_smod_pow2): Use profile. (expand_divmod): Use profile. * simplify-rtx.c (simplify_binary_operation_1): Update call of rtx_cost. * loop-invariant.c (create_new_invariant): Use profile. (gain_for_invariant): Add speed parameter. (best_gain_for_invariant): Likewise. (find_invariants_to_move): Likewise. (move_single_loop_invariants): Set it. * target-def.h (TARGET_RTX_COSTS): Use hook. * rtl.h (rtx_cost, address_cost, insn_rtx_cost): Update prototpe. (optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare. * output.h (default_address_cost): Update prototype. * combine.c (optimize_this_for_speed_p): New static var. (combine_validate_cost): Update call of rtx_cost. (combine_instructions): Set optimize_this_for_speed_p. (expand_compound_operation): Update call of rtx_cost. (make_extraction):Update call of rtx_cost. (force_to_mode):Update call of rtx_cost. (distribute_and_simplify_rtx):Update call of rtx_cost. * cfgloop.h (target_reg_cost, target_spill_cost): Turn to array. (estimate_reg_pressure_cost): Update prototype. * tree-flow.h (multiply_by_cost, create_mem_ref): Update prototype. * basic-block.h (optimize_insn_for_size_p, optimize_insn_for_speed_p): Remove. * config/alpha/alpha.c (alpha_rtx_costs): Update. (alpha_rtx_costs): Update. * config/frv/frv.c (frv_rtx_costs): Update. * config/s390/s390.c (s390_rtx_costs): Update. * config/m32c/m32c.c (m32c_memory_move_cost): Update. (m32c_rtx_costs): Update. * config/spu/spu.c (TARGET_ADDRESS_COST): Upate. (spu_rtx_costs): Update. * config/sparc/sparc.c (sparc_rtx_costs): Update. * config/m32r/m32r.c (m32r_rtx_costs): Update. * config/i386/i386.c (:ix86_address_cost): Update. (ix86_rtx_costs): Update. * config/sh/sh.c (sh_rtx_costs, sh_address_cost): Update. * config/pdp11/pdp11.c (pdp11_rtx_costs): Update. * config/avr/avr.c (avr_rtx_costs, avr_address_cost): Update. * config/crx/crx.c (crx_address_cost): Update. * config/xtensa/xtensa.c (xtensa_rtx_costs): Update. * config/stormy16/stormy16.c (xstormy16_address_cost, xstormy16_rtx_costs): Update. * config/m68hc11/m68hc11.c (m68hc11_address_cost, m68hc11_rtx_costs): Update. * config/cris/cris.c (cris_rtx_costs, cris_address_cost): Update. * config/iq2000/iq2000.c (iq2000_rtx_costs, iq2000_address_cost): Update. * config/mn10300/mn10300.c (mn10300_address_cost, mn10300_rtx_costs): Update * config/ia64/ia64.c (ia64_rtx_costs): Update. * config/m68k/m68k.c (m68k_rtx_costs): Update. * config/rs6000/rs6000.c (rs6000_rtx_costs): Update. * config/arc/arc.c (arc_rtx_costs, arc_address_cost): Update. * config/mcore/mcore.c (TARGET_ADDRESS_COST): Update. (mcore_rtx_costs): update. * config/score/score3.c (score3_rtx_costs): Update. * config/score/score7.c (score7_rtx_costs): Update. * config/score/score3.h (score3_rtx_costs):Update. * config/score/score7.h (score7_rtx_costs): Update. * config/score/score.c (score_rtx_costs): Update. * config/arm/arm.c (arm_address_cost): Update. (arm_rtx_costs_1): Update. (arm_rtx_costs_1): Update. (arm_size_rtx_costs): Update. (arm_size_rtx_costs): Update. (arm_size_rtx_costs): Update. (arm_xscale_rtx_costs): Update. (arm_thumb_address_cost): Update. * config/pa/pa.c (hppa_address_cost): Update. * config/mips/mips.c (mips_rtx_costs): Update. * config/vax/vax.c (vax_address_cost): Update. * config/h8300/h8300.c (h8300_shift_costs): Update. (h8300_rtx_costs): Update. * config/v850/v850.c (TARGET_ADDRESS_COST): Update. (v850_rtx_costs): Update. * config/mmix/mmix.c (mmix_rtx_costs, mmix_rtx_costs): Update. * config/bfin/bfin.c (bfin_address_cost): Update. (bfin_rtx_costs): Update. * stmt.c (lshift_cheap_p): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139821 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/rsandifo2008-08-281-28/+6
| | | | | | | | | | | * rtl.h (simplify_subreg_regno): Declare. * rtlanal.c (simplify_subreg_regno): New function, split out from... * simplify-rtx.c (simplify_subreg): ...here. * reload.c (find_reloads): Use simplify_subreg_regno instead of subreg_offset_representable_p. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139736 138bc75d-0d04-0410-961f-82ee72b054a4
* ChangeLog:uweigand2008-08-121-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | * defaults.h (TARGET_FLOAT_FORMAT): Remove. (UNKNOWN_FLOAT_FORMAT, IEEE_FLOAT_FORMAT, VAX_FLOAT_FORMAT): Remove. * config/alpha/alpha.h (TARGET_FLOAT_FORMAT): Remove. * config/iq2000/iq2000.h (TARGET_FLOAT_FORMAT): Remove. * config/pdp11/pdp11.h (TARGET_FLOAT_FORMAT): Remove. * config/score/score.h (TARGET_FLOAT_FORMAT): Remove. * config/vax/vax.h (TARGET_FLOAT_FORMAT): Remove. * doc/tm.texi (Storage Layout): Remove documentation for TARGET_FLOAT_FORMAT. * simplify-rtx.c (simplify_binary_operation_1): Replace TARGET_FLOAT_FORMAT check by appropriate HONOR_... checks. java/ChangeLog: * typeck.c (convert): Do not check for TARGET_FLOAT_FORMAT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139017 138bc75d-0d04-0410-961f-82ee72b054a4
* * real.h (struct real_format): New member has_sign_dependent_rounding.uweigand2008-08-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * real.c (ieee_single_format, mips_single_format, motorola_single_format, spu_single_format, ieee_double_format, mips_double_format, motorola_double_format, ieee_extended_motorola_format, ieee_extended_intel_96_format, ieee_extended_intel_128_format, ieee_extended_intel_96_round_53_format, ibm_extended_format, mips_extended_format, ieee_quad_format, mips_quad_format, vax_f_format, vax_d_format, vax_g_format): Initialize it. * config/pdp11/pdp11.c (pdp11_f_format, pdp11_d_format): Likewise. * defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES, MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): Remove. * config/spu/spu.h (MODE_HAS_NANS, MODE_HAS_INFINITIES, MODE_HAS_SIGN_DEPENDENT_ROUNDING): Remove. (ROUND_TOWARDS_ZERO): Likewise. * real.h (REAL_MODE_FORMAT): Protect MODE against macro expansion. (FLOAT_MODE_FORMAT): New macro. (REAL_MODE_FORMAT_COMPOSITE_P): Remove, replace by ... (MODE_COMPOSITE_P): ... this new macro. (MODE_HAS_NANS, MODE_HAS_INFINITIES, MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New macros. * machmode.h (GET_MODE_INNER): Cast result to enum machine_mode. * flags.h: Include "real.h". * fold-const.c (const_binop): Use MODE_COMPOSITE_P instead of REAL_MODE_FORMAT_COMPOSITE_P. * simplify-rtx.c (simplify_const_binary_operation): Likewise. * doc/tm.texi (Storage Layout): Remove documentation of MODE_HAS_NANS, MODE_HAS_INFINITIES, MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING. Update documentation of ROUND_TOWARDS_ZERO and LARGEST_EXPONENT_IS_NORMAL to clarify they only apply to libgcc2.a. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139016 138bc75d-0d04-0410-961f-82ee72b054a4
* PR middle-end/36447hutchinsonandy2008-06-091-0/+1
| | | | | | * simplify-rtx.c (simplify_subreg): Add check for shift count greater than size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136602 138bc75d-0d04-0410-961f-82ee72b054a4
* 2008-05-08 Paolo Bonzini <bonzini@gnu.org>dje2008-05-081-0/+18
| | | | | | | | | PR target/36090 * simplify-rtx.c (simplify_plus_minus): Create CONST of similar RTX_CONST_OBJ before CONST_INT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135086 138bc75d-0d04-0410-961f-82ee72b054a4
* 2008-03-06 Paolo Bonzini <bonzini@gnu.org>bonzini2008-03-061-0/+16
| | | | | | | | | * simplify-rtx.c (simplify_subreg): Remove useless shifts from word-extractions out of a multi-word object. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132971 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/rsandifo2008-02-281-5/+20
| | | | | | | | | | | * simplify-rtx.c (simplify_unary_operation_1): Extend the handling of SUBREG_PROMOTED_VAR_P to cope with cases where the extended value is smaller than the original promoted value. (simplify_subreg): If OP is a SUBREG, try to preserve its SUBREG_PROMOTED_VAR_P information. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132755 138bc75d-0d04-0410-961f-82ee72b054a4
* 2008-02-23 Andrew Pinski <andrew_pinski@playstation.sony.com>pinskia2008-02-231-0/+13
| | | | | | | | | | | | | | | | PR rtl-opt/33512 * simplify-rtx.c (simplify_binary_operation_1): Add simplification of (and X (ior (not X) Y) and (and (ior (not X) Y) X). 2008-02-23 Andrew Pinski <andrew_pinski@playstation.sony.com> PR rtl-opt/33512 * gcc.dg/and-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132575 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/34856uros2008-01-251-1/+6
| | | | | | | | | | | | | | | * simplifx-rtx.c (simplify_const_binary_operation) [VEC_CONCAT]: Consider only CONST_INT, CONST_DOUBLE and CONST_FIXED as constant vector elements. testsuite/ChangeLog: PR target/34856 * gcc.dg/pr34856.c: Use pointer mode for "pin". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131821 138bc75d-0d04-0410-961f-82ee72b054a4
* PR rtl-optimization/34490jakub2007-12-181-7/+9
| | | | | | | | | | * simplify-rtx.c (simplify_const_relational_operation): If !sign, don't reduce mmin/mmax using num_sign_bit_copies. * gcc.c-torture/execute/20071216-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131023 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/rsandifo2007-10-071-2/+9
| | | | | | | | * simplify-rtx.c (simplify_binary_operation_1): Canonicalize truncated shift counts. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129072 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-10-01 Paolo Bonzini <bonzini@gnu.org>bonzini2007-10-011-56/+54
| | | | | | | | * simplify-rtx.c (comparison_result, simplify_relational_operation_1): Rename CR_* constants to CMP_*. Fix spacing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128906 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-09-04 Paolo Bonzini <bonzini@gnu.org>bonzini2007-09-271-161/+266
| | | | | | | | | | | | | | | | | | * simplify-rtx.c (comparison_result): New. (simplify_const_relational_operation): Use it instead of the five "equal|op[01]ltu?" variables; consequently remove redundant "else"s. Improve bounds-checking optimizations; remove subsumed POPCOUNT optimizations. Extract nonzero_address_p optimizations into a separate "if" together with optimizations where op1 is const0_rtx. Optimize comparing an IOR with zero. Simplify op0 RELOP op0 for floating-point arguments too when appropriate. Hoist test for ABS outside the final switch statement. * cse.c (fold_rtx): Don't look for an IOR equivalent of folded_arg0 if we found a constant equivalent. Remove transformations done in simplify-rtx.c for "op0 RELOP op0". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128833 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_relational_operation_1): For recenthp2007-09-101-1/+3
| | | | | | | canonicalization, don't recurse if op1 equals both PLUS arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128323 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/30315rask2007-09-091-0/+6
| | | | | | | | | | * config/i386/i386.h (CANONICALIZE_COMPARISON): Delete. * simplify-rtx.c (simplify_relational_operation_1): Add the canonicalization from i386.h. * doc/md.texi (Canonicalization of Instructions): Document it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128305 138bc75d-0d04-0410-961f-82ee72b054a4
* Add new fp flags: -fassociative-math and -freciprocal-mathrevitale2007-09-041-4/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128075 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-lex.c (interpret_fixed): Declare.chaoyingfu2007-08-301-2/+56
| | | | | | | | | | | | | | | | | (interpret_float): Process _Fract and _Accum. (interpret_fixed): New function. * final.c (output_addr_const): Process CONST_FIXED. * simplify-rtx.c (simplify_const_unary_operation): Handle US_NEG. (simplify_binary_operation_1): Handle US_ASHIFT, SS_MULT, US_MULT, SS_DIV, US_DIV. (simplify_const_binary_operation): Handle SS_MULT, US_MULT, SS_DIV, US_DIV, US_ASHIFT. (simplify_immed_subreg): Support CONST_FIXED. Process MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM. (simplify_subreg): Support CONST_FIXED. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127941 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_binary_operation_1) [VEC_SELECT]:uros2007-08-291-1/+1
| | | | | | | | Change CONST_VECTOR_ELT to XVECEXP in elem calculation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127902 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/32661uros2007-08-281-0/+79
| | | | | | | | | | | | | | | | | * simplify-rtx.c (simplify_binary_operation_1) [VEC_SELECT]: Simplify nested VEC_SELECT (with optional VEC_CONCAT operator as operand) when top VEC_SELECT extracts scalar element. * config/i386/sse.md (*vec_extract_v4si_mem): New. (*vec_extract_v4sf_mem): Ditto. testsuite/ChangeLog: PR target/32661 * gcc.target/i386/pr32661.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127857 138bc75d-0d04-0410-961f-82ee72b054a4
* PR rtl-optimization/33148jakub2007-08-281-1/+2
| | | | | | | | | | * simplify-rtx.c (simplify_unary_operation_1): Only optimize (neg (lt X 0)) if X has scalar int mode. * gcc.c-torture/compile/20070827-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127855 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-common.c (vector_types_convertible_p,ghazi2007-08-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | decl_with_nonnull_addr_p, c_promoting_integer_type_p, self_promoting_args_p): Constify. * c-common.h (has_c_linkage, decl_with_nonnull_addr_p, c_promoting_integer_type_p, self_promoting_args_p, anon_aggr_type_p, vector_types_convertible_p): Likewise. * c-decl.c (anon_aggr_type_p): Likewise. * * c-dump.c (dump_stmt): Likewise. * c-objc-common.c (has_c_linkage): Likewise. * c-tree.h (same_translation_unit_p): Likewise. * c-typeck.c (null_pointer_constant_p, tagged_types_tu_compatible_p, function_types_compatible_p, type_lists_compatible_p, lvalue_or_else, lvalue_p, comptypes_internal, struct tagged_tu_seen_cache, same_translation_unit_p, alloc_tagged_tu_seen_cache, c_size_in_bytes): Likewise. * ggc-common.c (compare_ptr_data, hash_descriptor, eq_descriptor, hash_ptr, eq_ptr): Likewise. * langhooks-def.h (lhd_decl_ok_for_sibcall, LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Likewise. * langhooks.c (lhd_decl_ok_for_sibcall): Likewise. * langhooks.h (ok_for_sibcall, omp_privatize_by_reference): Likewise. * optabs.c (optab_for_tree_code): Likewise. * optabs.h (optab_for_tree_code): Likewise. * rtl.h (simplify_rtx): Likewise. * simplify-rtx.c (simplify_rtx): Likewise. * tree-dump.c (queue, queue_and_dump_index, queue_and_dump_type, dump_flag, dump_node): Likewise. * tree-dump.h (struct dump_info, dump_stmt, queue_and_dump_index, queue_and_dump_type, dump_flag): Likewise. * tree-flow.h (vect_can_force_dr_alignment_p): Likewise. * tree-pass.h (dump_node): Likewise. * tree-vectorizer.c (vect_can_force_dr_alignment_p, supportable_narrowing_operation): Likewise. * tree-vectorizer.h (vect_can_force_dr_alignment_p, supportable_narrowing_operation): Likewise. * tree-vrp.c (needs_overflow_infinity, supports_overflow_infinity, is_negative_overflow_infinity, is_positive_overflow_infinity, is_overflow_infinity, vrp_val_is_max, vrp_val_is_min, nonnull_arg_p, get_value_range, vrp_operand_equal_p, update_value_range, add_equivalence, ssa_name_nonnegative_p, ssa_name_nonzero_p, fp_predicate): Likewise. * tree.c (auto_var_in_fn_p, empty_body_p): Likewise. * tree.h (empty_body_p, auto_var_in_fn_p, ssa_name_nonzero_p, ssa_name_nonnegative_p): Likewise. cp: * call.c (sufficient_parms_p): Constify. * class.c (same_signature_p): Likewise. * cp-gimplify.c (is_invisiref_parm, cxx_omp_privatize_by_reference): Likewise. * cp-objcp-common.c (has_c_linkage): Likewise. * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK, sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p, grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for, num_artificial_parms_for, comp_template_parms, template_parameter_pack_p, any_dependent_template_arguments_p, any_type_dependent_arguments_p, any_value_dependent_elements_p, repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p, zero_init_p, member_p, cp_lvalue_kind, builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p, varargs_function_p, is_dummy_object, special_function_kind, string_conv_p, type_unknown_p, comp_except_specs, compparms, comp_cv_qualification, is_bitfield_expr_with_lowered_type, unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly, cp_has_mutable_p, at_least_as_qualified_p, invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise. * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise. * except.c (nothrow_libfn_p): Likewise. * method.c (skip_artificial_parms_for, num_artificial_parms_for): Likewise. * pt.c (comp_template_parms, template_parameter_pack_p, any_type_dependent_arguments_p, any_value_dependent_elements_p, any_dependent_template_arguments_p): Likewise. * repo.c (repo_export_class_p): Likewise. * semantics.c (anon_aggr_type_p): Likewise. * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p, builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p, varargs_function_p, member_p, is_dummy_object, pod_type_p, zero_init_p, special_function_p): Likewise. * typeck.c (comp_array_types, type_unknown_p, comp_except_specs, comp_array_types, at_least_as_qualified_p, comp_cv_qualification, compparms, invalid_nonstatic_memfn_p, is_bitfield_expr_with_lowered_type, unlowered_expr_type, string_conv_p, ptr_reasonably_similar, cp_type_readonly, cp_has_mutable_p, lvalue_or_else): Likewise. fortran: * trans-openmp.c (gfc_omp_privatize_by_reference): Constify. * trans.h (gfc_omp_privatize_by_reference): Likewise. java: * lang.c (java_decl_ok_for_sibcall): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127799 138bc75d-0d04-0410-961f-82ee72b054a4
* fixed -ffinite-math-only A-A missing optimisationchrbr2007-08-221-6/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127705 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_binary_operation_1): Removed erroneoussimonb2007-08-091-2/+0
| | | | | | | | break that was preventing simplify_associative_operation() for xor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127319 138bc75d-0d04-0410-961f-82ee72b054a4
* Change copyright header to refer to version 3 of the GNU General Public ↵nickc2007-07-261-4/+3
| | | | | | License and to point readers at the COPYING3 file and the FSF's license web page. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126948 138bc75d-0d04-0410-961f-82ee72b054a4
* * cfglayout.c (insn_scope, insn_line): Constify.ghazi2007-07-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * emit-rtl.c (const_int_htab_hash, const_int_htab_eq, const_double_htab_hash, const_double_htab_eq, mem_attrs_htab_hash): Likewise. * loop-iv.c (biv_eq): Likewise. * print-rtl.c (print_rtx, print_decl_name, print_mem_expr, print_inline_rtx, debug_rtx, debug_rtx_list, debug_rtx_range, debug_rtx_find, print_rtl, print_rtl_single, print_simple_rtl): Likewise. * rtl-error.c (location_for_asm, diagnostic_for_asm, error_for_asm, warning_for_asm, _fatal_insn, _fatal_insn_not_found): Likewise. * rtl.c (rtx_size, shared_const_p, shallow_copy_rtx_stat, rtx_equal_p, rtl_check_failed_bounds, rtl_check_failed_type1, rtl_check_failed_type2, rtl_check_failed_code1, rtl_check_failed_code2, rtl_check_failed_code_mode, rtvec_check_failed_bounds, rtl_check_failed_flag): Likewise. * rtl.h (rtl_check_failed_bounds, rtl_check_failed_type1, rtl_check_failed_type2, rtl_check_failed_code1, rtl_check_failed_code2, rtl_check_failed_code_mode, rtvec_check_failed_bounds, rtl_check_failed_flag, LABEL_KIND, SET_LABEL_KIND, rhs_regno, subreg_lsb, subreg_regno, subreg_nregs, shared_const_p, rtx_size, shallow_copy_rtx_stat, rtx_equal_p, get_pool_mode, insn_line, insn_file, simplify_replace_rtx, mode_signbit_p, rtx_addr_can_trap_p, nonzero_address_p, rtx_unstable_p, get_integer_term, get_related_value, offset_within_block_p, reg_mentioned_p, count_occurrences, reg_referenced_p, reg_used_between_p, no_labels_between_p, single_set_2, multiple_sets, set_noop_p, refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_reg_note, find_regno_note, find_reg_equal_equiv_note, find_constant_src, find_reg_fusage, find_regno_fusage, pure_call_p, remove_note, side_effects_p, volatile_refs_p, volatile_insn_p, may_trap_p, may_trap_after_code_motion_p, may_trap_or_fault_p, inequality_comparisons_p, tablejump_p, computed_jump_p, auto_inc_p, in_expr_list_p, remove_node_from_expr_list, loc_mentioned_in_p, label_is_jump_target_p, reversed_comparison_code_parts, debug_rtx, debug_rtx_list, debug_rtx_range, debug_rtx_find, print_mem_expr, print_rtl, print_simple_rtl, print_rtl_single, print_inline_rtx): Likewise. * rtlanal.c (covers_regno_p, covers_regno_no_parallel_p, computed_jump_p_1, nonzero_bits1, rtx_unstable_p, rtx_addr_can_trap_p_1, rtx_addr_can_trap_p, nonzero_address_p, get_integer_term, get_related_value, offset_within_block_p, count_occurrences, reg_mentioned_p, no_labels_between_p, reg_used_between_p, reg_referenced_p, single_set_2, multiple_sets, set_noop_p, refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, covers_regno_no_parallel_p, covers_regno_p, dead_or_set_regno_p, find_reg_note, find_regno_note, find_reg_equal_equiv_note, find_constant_src, find_reg_fusage, find_regno_fusage, pure_call_p, remove_note, in_expr_list_p, remove_node_from_expr_list, volatile_insn_p, volatile_refs_p, side_effects_p, may_trap_p_1, may_trap_p, may_trap_after_code_motion_p, may_trap_or_fault_p, inequality_comparisons_p, tablejump_p, computed_jump_p_1, computed_jump_p, auto_inc_p, loc_mentioned_in_p, subreg_lsb, subreg_regno, subreg_nregs, label_is_jump_target_p): Likewise. * simplify-rtx.c (neg_const_int, plus_minus_operand_p, mode_signbit_p, simplify_replace_rtx, plus_minus_operand_p): Likewise. * toplev.h (_fatal_insn_not_found, _fatal_insn, error_for_asm, warning_for_asm): Likewise. * tree.h (print_rtl): Likewise. * varasm.c (get_pool_mode): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126922 138bc75d-0d04-0410-961f-82ee72b054a4
* PR middle-end/PR28690bergner2007-07-231-19/+13
| | | | | | | | | | | | | | | | | | | | * optabs.c (expand_binop): (emit_cmp_and_jump_insns): Allow EQ compares. * rtlanal.c (commutative_operand_precedence): Prefer both REG_POINTER and MEM_POINTER operands over REG and MEM operands. (swap_commutative_operands_p): Change return value to bool. * rtl.h: Update the corresponding prototype. * tree-ssa-address.c (gen_addr_rtx): Use simplify_gen_binary instead of gen_rtx_PLUS. * simplify-rtx.c (simplify_plus_minus_op_data_cmp): Change return value to bool. Change function arguments to rtx's and update code to match. (simplify_plus_minus): Update the simplify_plus_minus_op_data_cmp calls to match the new declaration. * simplify-rtx.c (simplify_associative_operation): Don't reorder simplify_binary_operation arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126852 138bc75d-0d04-0410-961f-82ee72b054a4
* PR rtl-optimization/32366uros2007-06-171-4/+6
| | | | | | | | | | | | | | | * simplify-rtx.c (simplify_unary_operation_1) [FLOAT_TRUNCATE, FLOAT_EXTEND]: Prevent non-scalar modes from entering significand_size. testsuite/ChangeLog: PR rtl-optimization/32366 * testsuite/gcc.dg/vect/pr32366.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125777 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (fold_binary): Guard (X-X) -> 0 transformationghazi2007-06-121-2/+6
| | | | | | | | | with !HONOR_NANS and !HONOR_INFINITIES. * simplify-rtx.c (simplify_binary_operation_1): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125652 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-04-11 Richard Guenther <rguenther@suse.de>rguenth2007-04-111-3/+6
| | | | | | | | | PR middle-end/31530 * simplify-rtx.c (simplify_binary_operation_1): Do not simplify a * -b + c as c - a * b if we honor sign dependent rounding. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123715 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/rsandifo2007-03-211-8/+0
| | | | | | | | | | | | * rtl.h (constant_pool_reference_p): Delete. (find_constant_src): Declare. * rtlanal.c (find_constant_src): New function. * simplify-rtx.c (constant_pool_reference_p): Delete. * config/i386/i386.md: Use find_constant_src instead of constant_pool_reference_p/avoid_constant_pool_reference pairs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123106 138bc75d-0d04-0410-961f-82ee72b054a4
* PR rtl-optimization/28173sayle2007-02-191-0/+39
| | | | | | | | | | | | | | * simplify-rtx.c (simplify_binary_operation_1) <IOR>: Optimize (X & C1) | C2 as C2 when (C1 & C2) == C1 and X has no side-effects. Optimize (X & C1) | C2 as X | C2 when (C1 | C2) == ~0. Canonicalize (X & C1) | C2 as (X & (C1 & ~C2)) | C2. <AND>: Canonicalize (X | C1) & C2 as (X & C2) | (C1 & C2). * gcc.target/i386/andor-1.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122116 138bc75d-0d04-0410-961f-82ee72b054a4
* ./:ian2007-02-131-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common.opt: Add Wstrict-overflow and Wstrict-overflow=. * flags.h (warn_strict_overflow): Declare. (enum warn_strict_overflow_code): Define. (issue_strict_overflow_warning): New static inline function. * opts.c (warn_strict_overflow): New variable. (common_handle_option): Handle OPT_Wstrict_overflow and OPT_Wstrict_overflow_. * c-opts.c (c_common_handle_option): Set warn_strict_overflow for OPT_Wall. * fold-const.c: Include intl.h. (fold_deferring_overflow_warnings): New static variable. (fold_deferred_overflow_warning): New static variable. (fold_deferred_overflow_code): New static variable. (fold_defer_overflow_warnings): New function. (fold_undefer_overflow_warnings): New function. (fold_undefer_and_ignore_overflow_warnings): New function. (fold_deferring_overflow_warnings_p): New function. (fold_overflow_warning): New static function. (make_range): Add strict_overflow_p parameter. Change all callers. (extract_muldiv, extract_muldiv_1): Likewise. (fold_unary) [ABS_EXPR]: Check ABS_EXPR before calling tree_expr_nonnegative_p. (fold_negate_expr): Call fold_overflow_warning. (fold_range_test): Likewise. (fold_comparison): Likewise. (fold_binary): Likewise. Call tree_expr_nonnegative_warnv_p instead of tree_expr_nonnegative_p. (tree_expr_nonnegative_warnv_p): Rename from tree_expr_nonnegative_p, add strict_overflow_p parameter. (tree_expr_nonnegative_p): New function. (tree_expr_nonzero_warnv_p): Rename from tree_expr_nonzero_p, add strict_overflow_p parameter. (tree_expr_nonzero_p): New function. * passes.c (verify_interpass_invariants): New static function. (execute_one_pass): Call it. * tree-ssa-loop-niter.c (expand_simple_operations): Ignore fold warnings. (number_of_iterations_exit, loop_niter_by_eval): Likewise. (estimate_numbers_of_iterations): Likewise. (scev_probably_wraps_p): Likewise. * tree-ssa-ccp.c: Include "toplev.h". (evaluate_stmt): Defer fold overflow warnings until we know we are going to optimize. (struct fold_stmt_r_data): Add stmt field. (fold_stmt_r): Defer fold overflow warnings until we know we optimized. (fold_stmt): Initialize stmt field of fold_stmt_r_data. (fold_stmt_inplace): Likewise. * tree-cfgcleanup.c: Include "toplev.h" rather than "errors.h". (cleanup_control_expr_graph): Defer fold overflow warnings until we know we are going to optimize. * tree-cfg.c (fold_cond_expr_cond): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (vrp_expr_computes_nonnegative): Call tree_expr_nonnegative_warnv_p instead of tree_expr_nonnegative_p. * tree-ssa-loop-manip.c (create_iv): Likewise. * c-typeck.c (build_conditional_expr): Likewise. (build_binary_op): Likewise. * tree-vrp.c (vrp_expr_computes_nonzero): Call tree_expr_nonzero_warnv_p instead of tree_expr_nonzero_p. (extract_range_from_unary_expr): Likewise. * simplify-rtx.c (simplify_const_relational_operation): Warn when assuming that signed overflow does not occur. * c-common.c (pointer_int_sum): Ignore fold overflow warnings. * tree.h (tree_expr_nonnegative_warnv_p): Declare. (fold_defer_overflow_warnings): Declare. (fold_undefer_overflow_warnings): Declare. (fold_undefer_and_ignore_overflow_warnings): Declare. (fold_deferring_overflow_warnings_p): Declare. (tree_expr_nonzero_warnv_p): Declare. * doc/invoke.texi (Option Summary): Add -Wstrict-overflow to list of warning options. (Warning Options): Document -Wstrict-overflow. * Makefile.in (tree-ssa-threadedge.o): Depend on toplev.h. (tree-ssa-ccp.o): Likewise. (tree-cfgcleanup.o): Change errors.h dependency to toplev.h. (fold-const.o): Depend on intl.h. testsuite/: * gcc.dg/Wstrict-overflow-1.c: New test. * gcc.dg/Wstrict-overflow-2.c: New test. * gcc.dg/Wstrict-overflow-3.c: New test. * gcc.dg/Wstrict-overflow-4.c: New test. * gcc.dg/Wstrict-overflow-5.c: New test. * gcc.dg/Wstrict-overflow-6.c: New test. * gcc.dg/Wstrict-overflow-7.c: New test. * gcc.dg/Wstrict-overflow-8.c: New test. * gcc.dg/Wstrict-overflow-9.c: New test. * gcc.dg/Wstrict-overflow-10.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121895 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_relational_operation_1): Correct typo.sayle2007-02-121-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121839 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_relational_operation_1): Optimizesayle2007-02-121-0/+29
| | | | | | | | | | | | comparisons of POPCOUNT against zero. (simplify_const_relational_operation): Likewise. * gcc.target/ia64/builtin-popcount-1.c: New test case. * gcc.target/ia64/builtin-popcount-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121838 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_unary_operation_1) <POPCOUNT>: We cansayle2007-02-081-5/+84
| | | | | | | | | | | | | | | strip zero_extend, bswap and rotates from POCOUNT's argument. <PARITY>: Likewise, we can strip not, bswap, sign_extend, zero_extend and rotates from PARITY's argument. <BSWAP>: A byte-swap followed by a byte-swap is an identity. (simplify_const_unary_operation) <BSWAP>: Evaluate the byte-swap of an integer constant at compile-time. * gcc.target/i386/builtin-bswap-2.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121716 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_relational_operation_1): Implement somesayle2007-02-031-19/+59
| | | | | | | | | canonicalization transformations that attempt to simplify integer constant comparisons to become comparisons against zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121544 138bc75d-0d04-0410-961f-82ee72b054a4
* ./:ian2007-01-281-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common.opt: Add fstrict-overflow. * opts.c (decode_options): Set flag_strict_overflow if -O2. * flags.h (TYPE_OVERFLOW_WRAPS): Define. (TYPE_OVERFLOW_UNDEFINED): Define. (TYPE_OVERFLOW_TRAPS): Define. This replaces TYPE_TRAP_SIGNED. Replace all uses. * tree.h (TYPE_TRAP_SIGNED): Don't define. * fold-const.c (negate_expr_p): Use TYPE_OVERFLOW_UNDEFINED. (fold_negate_expr): Likewise. (make_range): Likewise. (extract_muldiv_1): Likewise. (maybe_canonicalize_comparison): Likewise. (fold_comparison): Likewise. (fold_binary): Likewise. (tree_expr_nonnegative_p): Likewise. (tree_expr_nonzero_p): Likewise. * tree-vrp.c (compare_values): Likewise. (extract_range_from_binary_expr): Likewise. (extract_range_from_unary_expr): Likewise. * tree-ssa-loop-niter.c (infer_loop_bounds_from_signedness): Likewise. (nowrap_type_p): Likewise. * tree-scalar-evolution.c (simple_iv): Likewise. * fold-const.c (negate_expr_p): Use TYPE_OVERFLOW_WRAPS. (build_range_check): Likewise. (extract_muldiv_1): Likewise. (fold_comparison): Likewise. * tree-vrp.c (vrp_int_const_binop): Likewise. (extract_range_from_unary_expr): Likewise. * convert.c (convert_to_integer): Likewise. * fold-const.c (fold_negate_expr): Use TYPE_OVERFLOW_TRAPS. (fold_comparison): Likewise. (fold_binary): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-vectorizer.c (vect_is_simple_reduction): Likewise. * simplify-rtx.c (simplify_const_relational_operation): Check flag_strict_overflow and flag_trapv. (simplify_const_relational_operation): Likewise. * doc/invoke.texi (Option Summary): Mention -fstrict-overflow. (Optimize Options): Add -fstrict-overflow to -O2 list. Document -fstrict-overflow. testsuite/: * gcc.dg/strict-overflow-1.c: New test. * gcc.dg/no-strict-overflow-1.c: New test. * gcc.dg/strict-overflow-2.c: New test. * gcc.dg/no-strict-overflow-2.c: New test. * gcc.dg/strict-overflow-3.c: New test. * gcc.dg/no-strict-overflow-3.c: New test. * gcc.dg/strict-overflow-4.c: New test. * gcc.dg/no-strict-overflow-4.c: New test. * gcc.dg/fold-mod-1.c: Add -fstrict-overflow option. * gcc.dg/pr15784-1.c: Likewise. * gcc.dg/pr20922-1.c: Likewise. * gcc.dg/pr20922-3.c: Likewise. * gcc.dg/pr20922-4.c: Likewise. * gcc.dg/pr20922-6.c: Likewise. * gcc.dg/compare-4.c: Likewise. * gcc.dg/torture/pr26898-1.c: Likewise. * gcc.dg/tree-ssa/divide-1.c: Likewise. * gcc.dg/tree-ssa/divide-2.c: Likewise. * gcc.dg/tree-ssa/divide-3.c: Likewise. * gcc.dg/tree-ssa/divide-4.c: Likewise. * gcc.dg/tree-ssa/pr14490-1.c: Likewise. * gcc.dg/tree-ssa/pr14490-3.c: Likewise. * gcc.dg/tree-ssa/pr21082.c: Likewise. * gcc.dg/tree-ssa/pr26899.c: Likewise. * g++.dg/tree-ssa/pr21082.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121254 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_subreg): Use the correct mode whensayle2006-12-211-5/+14
| | | | | | | | | determining whether a SUBREG of a CONCAT refers to the first or second component. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120101 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/rsandifo2006-11-301-3/+3
| | | | | | | | * simplify-rtx.c (simplify_rtx): Use simplify_subreg rather than simplify_gen_subreg. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119380 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-11-09 Andreas Krebbel <krebbel1@de.ibm.com>krebbel2006-11-091-0/+3
| | | | | | | | | | | | | * simplify-rtx.c (avoid_constant_pool_reference): Avoid calling simplify_subreg with BLKmode outer mode. 2006-11-09 Andreas Krebbel <krebbel1@de.ibm.com> * gcc.dg/20061109-1.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118622 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-09-07 Eric Christopher <echristo@apple.com>geoffk2006-11-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Falk Hueffner <falk@debian.org> * doc/extend.texi (__builtin_bswap32): Document. (__builtin_bswap64): Ditto. * doc/libgcc.texi (bswapsi2): Document. (bswapdi2): Ditto. * doc/rtl.texi (bswap): Document. * optabs.c (expand_unop): Don't widen a bswap. (init_optabs): Init bswap. Set libfuncs explicitly for bswapsi2 and bswapdi2. * optabs.h (OTI_bswap): New. (bswap_optab): Ditto. * genopinit.c (optabs): Handle bswap_optab. * tree.h (tree_index): Add TI_UINT32_TYPE and TI_UINT64_TYPE. (uint32_type_node): New. (uint64_type_node): Ditto. * tree.c (build_common_tree_nodes_2): Initialize uint32_type_node and uint64_type_node. * builtins.c (expand_builtin_bswap): New. (expand_builtin): Call. (fold_builtin_bswap): New. (fold_builtin_1): Call. * fold-const.c (tree_expr_nonnegative_p): Return true for bswap. * builtin-types.def (BT_UINT32): New. (BT_UINT64): Ditto. (BT_FN_UINT32_UINT32): Ditto. (BT_FN_UINT64_UINT64): Ditto. * builtins.def (BUILT_IN_BSWAP32): New. (BUILT_IN_BSWAP64): Ditto. * rtl.def (BSWAP): New. * genattrtab.c (check_attr_value): New. * libgcc2.c (__bswapSI2): New. (__bswapDI2): Ditto. * libgcc2.h (__bswapSI2): Declare. (__bswapDI2): Ditto. * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2. * simplify-rtx.c (simplify_const_unary_operation): Return 0 for BSWAP. * libgcc-std.ver (__bwapsi2): Add. (__bswapdi2): Ditto. * reload1.c (eliminate_regs_1): Add bswap. (elimination_effects): Ditto. * config/i386/i386.h (x86_bswap): New. (TARGET_BSWAP): Use. * config/i386/i386.c (x86_bswap): Set. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118361 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-10-21 Richard Guenther <rguenther@suse.de>rguenth2006-10-211-2/+2
| | | | | | | | | | | PR middle-end/28796 * simplify-rtx.c (simplify_const_relational_operation): Do not constant-fold ORDERED and UNORDERED for flag_unsafe_math_optimizations but only we do not need to honor NaNs for the given mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117928 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-09-05 Paolo Bonzini <bonzini@gnu.org>bonzini2006-09-051-47/+46
| | | | | | | | | | | | | | PR rtl-optimization/26847 * simplify-rtx.c (struct simplify_plus_minus_op_data): Remove ix. (simplify_plus_minus_op_data_cmp): For REGs, break ties on the regno. (simplify_plus_minus): Count n_constants while filling ops. Replace qsort with insertion sort. Before going through the array to simplify pairs, sort it. Delay early exit until after the first sort, exiting only if no swaps occurred. Simplify pairs in reversed order, without special-casing the first iteration. Pack ops after simplifying pairs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116701 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-08-11 Richard Guenther <rguenther@suse.de>rguenth2006-08-111-9/+8
| | | | | | | | | | | | PR middle-end/28651 * simplify-rtx.c (simplify_const_relational_operation): Simplify A CMP B to A - B CMP 0 only for EQ and NE comparison codes. * gcc.c-torture/execute/pr28651.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116079 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_binary_operation_1) <LSHIFTRT>: Castsayle2006-05-301-1/+1
| | | | | | | | width to HOST_WIDE_INT to avoid comparison warnings on some targets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114248 138bc75d-0d04-0410-961f-82ee72b054a4
* * simplify-rtx.c (simplify_binary_operation): Unfactor the shiftsayle2006-05-301-2/+26
| | | | | | | | | | | | | and rotate cases. <LSHIFTRT>: Optimize (lshiftrt (clz X) C) as (eq X 0) where C is log2(GET_MODE_BITSIZE(X)) on targets with the appropriate semantics. * gcc.target/ppc-eq0-1.c: New test case. * gcc.target/ppc-negeq0-1.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114239 138bc75d-0d04-0410-961f-82ee72b054a4
* PR tree-optimization/24964sayle2006-05-291-7/+29
| | | | | | | | | | | | | * simplify-rtx.c (simplify_binary_operation_1): Add function comment. <MULT>: Minor clean-up. Don't convert x*-1.0 into -x if we honor signaling NaNs. Optimize -x*-x as x*x for all float modes, and abs(x)*abs(x) as x*x for scalar floating point modes. * gcc.target/i386/387-10.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114206 138bc75d-0d04-0410-961f-82ee72b054a4