summaryrefslogtreecommitdiff
path: root/gcc/combine.c
Commit message (Collapse)AuthorAgeFilesLines
* rtl.def: Add unordered fp comparisions.Richard Henderson2000-01-241-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rtl.def: Add unordered fp comparisions. * tree.def: Likewise. * tree.h: Add ISO C 9x unordered fp comparision builtins. * builtins.c (expand_tree_builtin): New function. * c-typeck.c (build_function_call): Use it. (build_binary_op): Support unordered compares. * c-common.c (c_common_nodes_and_builtins): Add unordered compares. * combine.c (known_cond): Handle reverse_condition returning UNKNOWN. (reversible_comparison_p): Allow UNORDERED/ORDERED to be reversed. * cse.c (fold_rtx): Check FLOAT_MODE_P before reversing. (record_jump_equiv): Handle reverse_condition returning UNKNOWN. * jump.c (reverse_condition): Don't abort for UNLE etc, but return UNKNOWN. (swap_condition): Handle unordered compares. (thread_jumps): Check can_reverse before reversing. * loop.c (get_condition): Likewise. Allow UNORERED/ORDERED to be reversed for FP. * optabs.c (can_compare_p): New argument CODE. Verify branch or setcc is present before acking for cmp_optab. Update all callers. (prepare_float_lib_cmp, init_optabs): Handle UNORDERED. * expmed.c (do_cmp_and_jump): Update for can_compare_p. * expr.c (expand_expr): Likewise. Support unordered compares. (do_jump, do_store_flag): Likewise. * expr.h (enum libfunc_index): Add unordered compares. * Makefile.in (FPBIT_FUNCS): Add _unord_sf. (DPBIT_FUNCS): Add _unord_df. * config/fp-bit.c (_unord_f2): New. * fp-test.c (main): Try unordered compare builtins. * alpha-protos.h (alpha_fp_comparison_operator): Declare. * alpha.c (alpha_comparison_operator): Check mode properly. (alpha_swapped_comparison_operator): Likewise. (signed_comparison_operator): Likewise. (alpha_fp_comparison_operator): New. (alpha_emit_conditional_branch): Handle unordered compares. * alpha.h (PREDICATE_CODES): Update. * alpha.md (fp compares): Use alpha_fp_comparison_operator. (bunordered, bordered): New. * cp/call.c (build_over_call): Use expand_tree_builtin. * cp/typeck.c (build_function_call_real): Likewise. (build_binary_op_nodefault): Handle unordered compares. * gcc.c-torture/execute/ieee/fp-cmp-4.c: New. From-SVN: r31591
* combine.c (combine_simplify_rtx): Give FLOAT_STORE_FLAG_VALUE a mode.Richard Henderson2000-01-171-3/+7
| | | | | | | | | | | | | * combine.c (combine_simplify_rtx): Give FLOAT_STORE_FLAG_VALUE a mode. * cse.c (find_comparison_args, fold_rtx): Likewise. * integrate.c (subst_constants): Likewise. * loop.c (get_condition): Likewise. * tm.texi (FLOAT_STORE_FLAG_VALUE): Update docs. * alpha.h (FLOAT_STORE_FLAG_VALUE): Use REAL_VALUE_ATOF. From-SVN: r31479
* cccp.c: PROTO -> PARAMS.Kaveh R. Ghazi2000-01-141-68/+68
| | | | | | | | | | | | | | | | | | | | * cccp.c: PROTO -> PARAMS. * cexp.y: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.h: Likewise. * cse.c: Likewise. * dbxout.c: Likewise. * dbxout.h: Likewise. * diagnostic.c: Likewise. * doprint.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * dwarfout.c: Likewise. * dwarfout.h: Likewise. * dyn-string.h: Likewise. From-SVN: r31399
* combine.c (if_then_else_cond): Be careful about what kinds of RTL ↵Jeffrey A Law2000-01-131-1/+4
| | | | | | | | | expressions are passed to operand_subword. * combine.c (if_then_else_cond): Be careful about what kinds of RTL expressions are passed to operand_subword. From-SVN: r31383
* combine.c (expand_field_assignment): Do not discard SUBREGs while computing ↵Alexandre Oliva2000-01-101-0/+2
| | | | | | | | | nonzero_bits. * combine.c (expand_field_assignment): Do not discard SUBREGs while computing nonzero_bits. From-SVN: r31304
* Update copyrightJeff Law2000-01-041-1/+1
| | | | From-SVN: r31194
* combine.c (expand_compound_operation): Do not convert ZERO_EXTEND to ↵Jan Hubicka2000-01-031-28/+64
| | | | | | | | | | | SIGN_EXTEND, convert SIGN_EXTEND to ZERO_EXTEND. * combine.c (expand_compound_operation): Do not convert ZERO_EXTEND to SIGN_EXTEND, convert SIGN_EXTEND to ZERO_EXTEND. (make_compound_operation): Choose cheaper alternative between ZERO_EXTEND and SIGN_EXTEND when sign bit is not set. From-SVN: r31180
* combine.c (simplify_comparison): Reduce (OP (MINUS A B) 0) to (OP A B).Richard Henderson1999-12-161-0/+8
| | | | | | | * combine.c (simplify_comparison): Reduce (OP (MINUS A B) 0) to (OP A B). From-SVN: r30970
* Avoid making shared rtl.Bernd Schmidt1999-12-141-7/+13
| | | | From-SVN: r30910
* combine.c (combine_simplify_rtx): Fix order of checks for (ashiftrt foo C) ↵Jeffrey A Law1999-12-131-1/+1
| | | | | | | | | -> (lt foo (const_int 0)) simplification. * combine.c (combine_simplify_rtx): Fix order of checks for (ashiftrt foo C) -> (lt foo (const_int 0)) simplification. From-SVN: r30894
* combine.c (record_promoted_value): Remove unused variable `links2'.Kaveh R. Ghazi1999-12-121-1/+1
| | | | | | | | | | | | | | * combine.c (record_promoted_value): Remove unused variable `links2'. * emit-rtl.c (renumber_insns): Likewise for `old_max_uid'. * global.c (record_conflicts): Likewise for `j'. * genoutput.c (output_insn_data): Don't unnecessarily cast away const-ness. From-SVN: r30870
* combine.c (try_combine, [...]): Remove REG_N_REFS updating code.Jan Hubicka1999-12-091-20/+0
| | | | | | | * combine.c (try_combine, distribute_notes): Remove REG_N_REFS updating code. From-SVN: r30842
* combine.c (check_promoted_subreg): Do not conditionalize this upon ↵David S. Miller1999-12-061-6/+0
| | | | | | | | | PROMOTE_FUNCTION_RETURN. * combine.c (check_promoted_subreg): Do not conditionalize this upon PROMOTE_FUNCTION_RETURN. From-SVN: r30814
* Fix ia64 execute/930630-1.c miscompilation.Jim Wilson1999-12-061-5/+6
| | | | | | | * combine.c (force_to_mode, case LSHIFTRT): New local inner_mask. Set inner_mask instead of mask. From-SVN: r30812
* combine.c (check_promoted_subreg, [...]): New functions.Jakub Jelinek1999-12-061-0/+93
| | | | | | | | | | * combine.c (check_promoted_subreg, record_promoted_value): New functions. (combine_instructions): Use them to retain nonzero and sign bit information after SUBREGs are eliminated by optimizations in this pass if PROMOTE_FUNCTION_RETURN. From-SVN: r30808
* combine.c (try_combine): Before fixing up LOG_LINKS for the i3_subst_into_i2 ↵J"orn Rennecke1999-12-021-13/+16
| | | | | | | | | case... * combine.c (try_combine): Before fixing up LOG_LINKS for the i3_subst_into_i2 case, check that GET_CODE (PATTERN (i2)) == PARALLEL. From-SVN: r30762
* combine.c (if_then_else_cond): Use const_true_rtx instead of const1_rtx for ↵Jeffrey A Law1999-12-011-2/+2
| | | | | | | | | | return values in EQ/NE comparison... * combine.c (if_then_else_cond): Use const_true_rtx instead of const1_rtx for return values in EQ/NE comparison against (const_int 0) case. From-SVN: r30749
* combine.c (try_combine): Only pass SET or CLOBBER to SET_DESTFranz Sirl1999-11-301-1/+3
| | | | | | | * combine.c (try_combine): Only pass SET or CLOBBER to SET_DEST * rs6000.md: Only access a CONST_INT with INTVAL From-SVN: r30729
* combine.c (setup_incoming_promotions): Pass an outgoing regno to ↵Jakub Jelinek1999-11-281-1/+7
| | | | | | | | | FUNCTION_ARG_REGNO_P which it expects. * combine.c (setup_incoming_promotions): Pass an outgoing regno to FUNCTION_ARG_REGNO_P which it expects. From-SVN: r30685
* combine.c (try_combine): Add code to try to merge a set of a two-word pseudo ↵Richard Kenner1999-11-271-0/+46
| | | | | | | | | | to a constant with a... * combine.c (try_combine): Add code to try to merge a set of a two-word pseudo to a constant with a setting of one of those words to a constant. From-SVN: r30674
* combine.c (combine_simplify_rtx): When handling a SUBREG, take SUBREG_WORD ↵J"orn Rennecke1999-11-221-1/+12
| | | | | | | | | | into account. * combine.c (combine_simplify_rtx): When handling a SUBREG, take SUBREG_WORD into account. (if_then_else_cond): Likewise. From-SVN: r30623
* bitmap.h (BITMAP_XFREE): New.Richard Henderson1999-11-041-3/+30
| | | | | | | | | | | | | | | | | | | | | * bitmap.h (BITMAP_XFREE): New. * flow.c (life_analysis): Use it. (life_analysis_1): Free blocks. * combine.c (undo_commit): New. (try_combine): Use it. Don't zap undobuf.undos. (combine_instructions): Don't zap undobuf.undos; free the undobuf.frees list. * local-alloc.c (local_alloc): Free qty_phys_num_sugg. * stmt.c (cost_table_): New. (estimate_case_costs): Use it instead of xmalloc. * toplev.c (compile_file): Reuse dumpname memory instead of strdup'ing it. From-SVN: r30404
* * combine.c (combine_instructions): Use xmalloc instead of alloca.Mark Mitchell1999-11-011-17/+28
| | | | From-SVN: r30331
* [multiple changes]Richard Kenner1999-10-311-7/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR> * gcov.c (DIR_SEPARATOR): Provide default. (output_data): Add test for MS-DOS format absolute filename. (fancy_abort): Correct program name. (open_files): Open all files in binary mode. * libgcc2.c (__bb_exit_func): Likewise. * profile.c (init_branch_prob): Specify binary when opening files. * flags.h (flag_unwind_tables): New decl. * toplev.c (flag_unwind_table): New definition. (f_options): Add -funwind-tables. (decode_g_option): Clarify warning when unknown -g option is given. (rest_of_compilation): If inside an inlined external function, pretend we are just being declared. * dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables. (dwarf2out_frame_finish): Likewise. Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com> * flow.c (propagate_block): When the last reference to a label before an ADDR_VEC is deleted because the reference is a dead store, delete the ADDR_VEC. Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt> * fold-const.c (merge_ranges): In not in0, but in1, handle upper bounds equal like subset case. Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com> * dbxout.c (dbxout_parms): Generate a second stabs line for parameters passed in a register but moved to the stack. Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr> * gcc.c (pass_exit_codes, greatest_status): New variables. (struct option_map): Add entry for "--pass-exit-codes". (execute): Update greatest_status if error. (display_help): Add documentation for -pass-exit-codes. (process_command): Handle -pass-exit-codes. (main): Look at pass_exit_codes and greatest_status on call to exit. Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * reload.c (find_reloads): Refine test for no input reload case to not includes reloads emitted after insn. * function.c (find_temp_slots_from_address): Handle sum involving a register that points to a temp slot. (update_temp_slot_address): Make recursive call if both old and new are PLUS with a common operand. * calls.c (expand_call): Mark temp slot for result as having address taken. * rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case. * gcc.c (process_command): Add standard_exec_prefix with "GCC" component as well as "BINUTILS". * integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS. * integrate.c (copy_rtx_and_substitute): Likewise. (expand_inline_function, integrate_parm_decls, integrate_decl_tree): All callers changed. * unroll.c (inital_reg_note_copy, copy_loop_body): Likewise. * dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use gdb extensions, write size of type; also be more consistent in using references when this is a subtype. * pa.md (extv, extzv, insv): Use define_expand to reject constant that is out of range. * loop.c (unknown_constant_address_altered): New variable. (prescan_loop): Initialize it. (note_addr_stored): Set it for RTX_UNCHANGING_P MEM. (invariant_p, case MEM): Remove handling for volatile and readony; check new variable if readonly. (check_dbra_loop): Chdeck unknown_constant_address_altered. * cse.c (canon_hash, case MEM): Do not record if BLKmode. (addr_affects_sp_p): Removed from note_mem_written and only define #ifdef AUTO_INC_DEC. * alpha.c (input_operand, case ADDRESSOF): Treat as REG. * regclass.c (record_reg_classes): Properly handle register move directions. * varasm.c (initializer_constant_valid_p, case MINUS_EXPR): Don't think valid if both operands are invalid. (struct constant_descriptor): New field RTL. (mark_const_hash_entry): Mark it. (record_constant{,_rtx}): Initialize it. (output_constant_def): Allocate RTL in permanent obstack and save in table. ({record,compare}_constant_1): Modes must match for CONSTRUCTOR of ARRAY_TYPE. * c-common.h (initializer_constant_valid_p): Delete decl from here. * output.h (initializer_constant_valid_p): Move decl to here. * c-common.c (initializer_constant_valid_p): Delete function from here. * varasm.c (initializer_constant_valid_p): Move function to here. * tree.h (STRIP_SIGN_NOPS): New macro. * fold-const.c (optimize_minmax_comparison): New function. (invert_truthvalue, case WITH_RECORD_EXPR): New case. (fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS. (fold, case EQ_EXPR): Call optimize_minmax_comparison and add cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and widening conversions. (fold, case LE_EXPR): Rework changing unsigned to signed comparisons to look at size of mode, not precision of type; also add missing cases. (optimize_bit_field_compare, decode_field_reference): Don't try to optimize COMPONENT_REF of a PLACEHOLDER_EXPR. * dwarf2out.c (ctype.h): Include. (dwarf2out_set_demangle_name_func): New function. (size_of_line_info): Deleted. (output_line_info): Compute size of line info table from difference of labels. (base_type_die, add_name_attribute): Call demangle function, if any. (field_byte_offset): Use bits per word for variable length fields. (gen_array_type_die): Add array name. (gen_subprogram_die): Ignore DECL_INLINE if -fno-inline. (dwarf2out_add_library_unit_info): New function. * explow.c (set_stack_check_libfunc): New function. (stack_check_libfunc): New static variable. (probe_stack_range): Allow front-end to set up a libfunc to call. * combine.c (simplify_comparison): When making comparison in wider mode, check for having commuted an AND and a SUBREG. (contains_muldiv): New function. (try_combine): Call it when dividing a PARALLEL. (simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart. (simplify_comparison, case ASHIFTRT): Recognize sign-extension of a PLUS. (record_value_for_reg): If TEM is a binary operation with two CLOBBERs, use one of the CLOBBERs instead. (if_then_else_cond): If comparing against zero, just return thing being compared. * optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x). Don't generate shifts and subtract if have conditional arithmetic. * rtl.h (delete_barrier): New declaration. * jump.c (jump_optimize): Set up to handle conditional call. In conditional arithmetic case, handle CALL_INSN followed by a BARRIER. (delete_barrier): New function. * rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode. * recog.c (nonmemory_operand): Accept ADDRESSOF. * tree.c (build_type_attribute_variant): Push to obstack of ttype around type_hash_canon call. * expr.c (placeholder_list): Move decl to file scope. (expand_expr): Don't force access to volatile just because its address is taken. If ignoring reference operations, just expand the operands. (expand_expr, case COMPONENT_REF): Propagate EXPAND_CONST_ADDRESS to recursive call when expanding inner. Refine test for using bitfield operations vs pointer punning. (expand_expr, case CONVERT_EXPR): If converting to BLKmode UNION_TYPE from BLKmode, just return inner object. Use proper mode in store_field call. Properly set sizes of object to store and total size in store_field call for convert to union. (expand_expr, case ARRAY_REF): If OP0 is in a register, put it in memory (like for ADDR_EXPR). Also, don't put constant in register if we'll want it in memory. (readonly_fields_p): New function. (expand_expr, case INDIRECT_REF): Call it if LHS. (expand_assignment): Handle a RESULT_DECL where DECL_RTL is a PARALLEL. (do_jump, case WITH_RECORD_EXPR): New case. (get_inner_reference): Always go inside a CONVERT_EXPR and NOP_EXPR if both modes are the same. (store_field): Use bitfield operations if size of bitsize is not same as size of RHS's type. Check for bitpos not a multiple of alignment in BLKmode case. Do block move in largest possible alignment. (store_constructor): Set BITSIZE to -1 for variable size and properly in case of array of BLKmode. (expand_expr_unaligned): New function. (do_compare_and_jump): Call it. * mips/iris5.h (SWITCHES_NEED_SPACES): New macro. * collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES does not include 'o'. * function.c (instantiate_virtual_regs_1, case SET): Handle case where both SET_DEST and SET_SRC reference a virtual register. (gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG. * integrate.c (expand_inline_function): Handle case of setting virtual stack vars register (from built in setjmp); when parameter lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early. (subst_constant): Add new parm, MEMONLY. (expand_inline_function, integrate_parm_decls): Pass new parm. (integrate_decl_tree): Likewise. (copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P. (try_constants): Call subst_constants twice, with MEMONLY 0 and 1. (copy_rtx_and_substitute, case SET): Add explicit calls to copy_rtx_and_substitute for both sides. * stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for constraints. (pushcase{,_range}): Convert to NOMINAL_TYPE after checking for within INDEX_TYPE, instead of before. (fixup_gotos): Use f->target_rtl, not the next insn, since latter may be from a later fixup. (expand_value_return): Correctly convert VAL when promoting function return; support RETURN_REG being a PARALLEL. (expand_return): When checking for result in regs and having cleanup, consider PARALLEL in DECL_RTL as being in regs. From-SVN: r30299
* combine.c (combine_simplify_rtx): Renamed from simplify_rtx.Jeffrey A Law1999-10-311-3/+3
| | | | | | | * combine.c (combine_simplify_rtx): Renamed from simplify_rtx. All references/callers changed. From-SVN: r30292
* rtl.h (note_stores): Add additional paramter.Mark Mitchell1999-10-271-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rtl.h (note_stores): Add additional paramter. * rtlanal.c (reg_set_p_1): Take additional paramter. (reg_set_last_1): Likewise. (reg_set_p): Adjust call to note_stores. (reg_set_last): Likewise. (note_stores): Pass data parameter to worker function. * alias.c (record_set): Take additional parameter. (init_alias_analysis): Pass it. * caller-save.c (mark_set_regs): Take additional parameter. (save_call_clobbered_regs): Pass NULL to note_stores. * combine.c (set_nonzero_bits_and_sign_copies): Take additional parameter. (record_dead_and_set_regs_1): Likewise. (reg_dead_at_p_1): Likewise. (combine_instructions): Adjust calls to note_stores. (try_combine): Likewise. (record_dead_insn): Remove. (record_dead_and_set_regs): Adjust calls to note_stores. (reg_dead_at_p): Likewise. * cse.c (invalidate_skipped_set): Take additional parameter. (cse_check_loop_start): Likewise. (cse_check_loop_start_value): Remove. (cse_set_around_loop): Adjust calls to note_stores. * flow.c (notice_stack_pointer_modification): Take additional parameter. Remove duplicate declaration. (record_volatile_insns): Adjust calls to note_stores. * gcse.c (record_set_info): Take additional parameter. (record_last_set_info): Likewise. (invalidate_nonnull_info): Likewise. (record_set_insn): Remove. (compute_sets): Adjust calls to note_stores. (last_set_insn): Remove. (compute_hash_table): Adjust calls to note_stores. (insert_insn_end_bb): Likewise. (delete_null_pointer_checks): Likewise. * global.c (mark_reg_store): Take additional parameter. (mark_reg_clobber): Likewise. (reg_becomes_live): Likewise. (global_conflicts): Adjust calls to note_stores. (build_insn_chain): Likewise. * integrate.c (note_modified_parmregs): Take additional parameter. (mark_stores): Likewise. Make it static. (save_for_inline_nocopy): Adjust calls to note_stores. (try_constants): Likewise. * integrate.h (mark_stores): Remove declaration. * jump.c (mark_modified_reg): Take additional parameter. (thread_jumps): Adjust calls to note_stores. * local-alloc.c (validate_equiv_mem_from_store): Take additional parameter. (no_equiv): Likewise. (reg_is_set): Likewise. (validate_equiv_mem): Adjust calls to note_stores. (update_equiv_regs): Likewise. (block_alloc): Likewise. * loop.c (note_set_pseudo_multiple_uses_retval): Remove. (note_addr_stored): Take additional parameter. (note_set_pseudo_multiple_uses): Likewise. (record_initial): Likewise. (prescan_loop): Adjust calls to note_stores. (strength_reduce): Likewise. (check_dbra_loop): Likewise. * regmove.c (flags_set_1): Take additional paramter. (mark_flags_life_zones): Adjust calls to note_stores. * reload1.c (mark_not_eliminable): Take additional parameter. (forget_old_reloads_1): Likewise. (reload_cse_invalidate_rtx): Likewise. (reload_cse_check_clobber): Likewise. (reload_combine_note_store): Likewise. (move2add_note_store): Likewise. (reload): Adjust calls to note_stores. (reload_as_needed): Likewise. (emit_reload_insns): Likewise. (reload_cse_regs_1): Likewise. (reload_cse_record_set): Adjust calls to reload_cse_invalidate_rtx. (reload_combine): Adjust calls to note_stores. * resource.c (update_live_status): Take additional paramter. (mark_target_live_regs): Adjust calls to note_stores. * stupid.c (find_clobbered_regs): Take additional parameter. (stupid_life_analysis): Adjust calls to note_stores. From-SVN: r30221
* basic-block.h (PROP_*): Move constants from ...Richard Henderson1999-10-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | * basic-block.h (PROP_*): Move constants from ... * flow.c: ... here. (compute_bb_for_insn): Free the array before reallocating. (update_life_info): New arg PROP_FLAGS; pass on to propagate_block. (allocate_reg_life_data): Reset all reg variables collected by propagate_block. (get_block_head_tail): Don't convert from bb to block. (get_bb_head_tail): New. Update all callers of get_block_head_tail. (find_insn_reg_weight): Take block not bb. (schedule_block): Don't set block num for moved insns. (schedule_region): Don't update_life_info or find_insn_reg_weight. (schedule_insns): Do it here instead. * combine.c (combine_instructions): Invoke compute_bb_for_insn before update_life_info. * recog.c (split_all_insns, peephole2_optimize): Update for new arg to update_life_info. * rtlanal.c (remove_note): Cope with NULL note. * toplev.c (rest_of_compilation): Don't invoke recompute_reg_usage if we did sched1. From-SVN: r30103
* combine.c (get_last_value): If the last set of a register is after ↵Jeffrey A Law1999-10-181-54/+2
| | | | | | | | | | subst_low_cuid... * combine.c (get_last_value): If the last set of a register is after subst_low_cuid, then we can not use it to determine the register's last value. From-SVN: r30062
* fold-const.c (fold): Move bit_rotate code to the EXPR_PLUS case, falltrought ↵Jan Hubicka1999-10-141-14/+9
| | | | | | | | | | | | | | to assocate code. * fold-const.c (fold): Move bit_rotate code to the EXPR_PLUS case, falltrought to assocate code. Convert XOR to OR in code like (a&c1)^(a&c2) where c1 and c2 don't have bits in common. * combine.c (simplify_logical): Convert XOR to IOR if operands have no bits in common; remove XOR to ROTATE conversion. From-SVN: r29998
* combine.c (simplify_logical): Recognize xor pattern that encodes rotation.Marc Espie1999-10-141-0/+15
| | | | | | | * combine.c (simplify_logical): Recognize xor pattern that encodes rotation. From-SVN: r29965
* combine.c (refresh_blocks, [...]): New.Richard Henderson1999-10-101-19/+18
| | | | | | | | | | | | | | * combine.c (refresh_blocks, need_refresh): New. (combine_instructions): Allocate refresh_blocks. Invoke update_life_info if needed. (distribute_notes): Mark refresh_blocks instead of installing USE insns. * flow.c (update_life_info): Remove notes if GLOBAL_RM_NOTES. * basic_block.h (enum update_life_extent): Add GLOBAL_RM_NOTES. * Makefile.in (recog.o): Depend on basic-block.h. From-SVN: r29893
* Makefile.in (flow.o): Depend on TREE_H.Richard Henderson1999-10-091-46/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in (flow.o): Depend on TREE_H. * basic-block.h (REG_SET_EQUAL_P): New. (XOR_REG_SET): New. (n_edges): Declare. (free_regset_vector): Remove declaration. (flow_delete_insn_chain): Declare. (enum update_life_extent): New. (update_life_info, count_or_remove_death_notes): Declare. * combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head. Verify register live at bb->global_live_at_start before adding USE. * flow.c (HAVE_epilogue, HAVE_prologue): Provide default. (CLEAN_ALLOCA): New. (n_edges): New. (PROP_*): New flags. (find_basic_blocks_1): Use alloc_EXPR_LIST. (clear_edges): Zero n_edges. (make_edge): Increment n_edges. (split_edge): Don't allocate bb->local_set. Increment n_edges. (flow_delete_insn_chain): Export. (delete_block): Decrement n_edges. (merge_blocks_nomove): Likewise. (life_analysis): Give life_analysis_1 PROP flags. (verify_wide_reg_1, verify_wide_reg): New. (verify_local_live_at_start): New. (update_life_info): Rewrite to call into propogate_block. (mark_reg): New. (mark_regs_live_at_end): After reload, if epilogue as rtl, always mark stack pointer. Conditionally mark PIC register. After reload, mark call-saved registers, return regsiters. (life_analysis_1): Accept PROP flags not remove_dead_code. Call mark_regs_live_at_end before zeroing regs_ever_live. Use calculate_global_regs_live. Copy global_live_at_end before calling final propagate_block. Zero reg_next_use on exit. (calculate_global_regs_live): New. (allocate_bb_life_data): Don't allocate bb->local_set. (init_regset_vector, free_regset_vector): Remove. (propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE. Test flags before every operation. Warn if prologue/epilogue insn would have been deleted. (mark_set_regs, mark_set_1): Accept and use FLAGS. Use alloc_EXPR_LIST. (mark_used_regs): Accept and use FLAGS, not FINAL. Remove special handling for RETURN. (try_pre_increment): Use alloc_EXPR_LIST. (dump_flow_info): Dump n_edges. (unlink_insn_chain, split_hard_reg_notes): Remove. (maybe_add_dead_note, maybe_add_dead_note_use): Remove. (find_insn_with_note, new_insn_dead_notes): Remove. (update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove. (maybe_remove_dead_notes, prepend_reg_notes): Remove. (replace_insns): Remove. (count_or_remove_death_notes): New. (verify_flow_info): Abort on error after all checks. (remove_edge): Decrement n_edges. (remove_fake_edges): Tweek format. * haifa-sched.c (schedule_insns): Use split_all_insns. * output.h (update_life_info): Remove declaration. * recog.c (split_all_insns): From the corpse of split_block_insns, do the whole function block by block. Use update_life_info. (recog_last_allowed_insn): New. (recog_next_insn): Mind it. (peephole2_optimize): Set it. Walk backwards through blocks. Use update_life_info. * rtl.h (update_flow_info, replace_insns): Remove declarations. (split_all_insns): Declare. * toplev.c (rest_of_compilation): Thread prologue before flow2. Use split_all_insns. * i386.md (or -1 peep2s): Disable. From-SVN: r29877
* combine.c (gen_rtx_combine): Add missing call to va_end().Kaveh R. Ghazi1999-09-261-0/+2
| | | | | | | | | | | | | * combine.c (gen_rtx_combine): Add missing call to va_end(). * final.c (asm_fprintf): Likewise. * genattrtab.c (attr_rtx): Likewise. cp: * lex.c (compiler_error): Add missing call to va_end(). From-SVN: r29667
* Cope with down shifting a 32 bit constant on a 64 bit host.Nick Clifton1999-09-241-2/+2
| | | | From-SVN: r29655
* Use unsigned shift instead of signed shift.Nick Clifton1999-09-231-2/+6
| | | | From-SVN: r29621
* Make it possible to prototype port-specific functions (and convert i386 to ↵Bernd Schmidt1999-09-201-0/+1
| | | | | | use this) From-SVN: r29515
* Replace insn_foo with insn_data.foo.Richard Henderson1999-09-121-25/+34
| | | | From-SVN: r29358
* combine.c (SUBST): Break out to a real function do_SUBST.Richard Henderson1999-09-091-47/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * combine.c (SUBST): Break out to a real function do_SUBST. (SUBST_INT): Likewise. * gcse.c (free_pre_mem): Free `temp_bitmap'. (pre_insert): Free `inserted'. * loop.c (basic_induction_var): Always set `location'. * function.c (expand_function_end): Add initial_trampoline as a root. * rtl.h (init_varasm_once): Declare. * toplev.c (compile_file): Call it. * ggc-simple.c (ggc_mark_string_ptr): New. (ggc_add_string_root): New. (ggc_collect): Disable collection avoidance temporarily. * ggc.h (ggc_add_string_root): Declare. * except.c (create_rethrow_ref): Use ggc_alloc_string. * optabs.c (init_libfuncs): Likewise. * varasm.c (named_section): Use ggc_alloc_string. (make_function_rtl): Likewise. (make_decl_rtl): Likewise. (assemble_static_space): Likewise. (assemble_trampoline_template): Likewise. (output_constant_def): Likewise. (force_const_mem): Likewise. (mark_const_hash_entry): New. (mark_pool_sym_hash_table): New. (mark_varasm_state): Use it. (init_varasm_once): New. * expr.h (init_one_libfunc): Declare. * optabs.c (init_one_libfunc): New. (init_optabs): Use it. * config/gofast.h: Likewise. * config/sparc/sol2.h (INIT_SUBTARGET_OPTABS): Likewise. * config/sparc/sparc.h (INIT_TARGET_OPTABS): Likewise. From-SVN: r29226
* Merge in gcc2-ss-010999Jeff Law1999-09-061-54/+127
| | | | From-SVN: r29150
* combine.c (simplify_rtx): Recognize another case of a synthesized sign ↵Jeffrey A Law1999-09-021-2/+4
| | | | | | | | | extension. * combine.c (simplify_rtx): Recognize another case of a synthesized sign extension. From-SVN: r29055
* combine.c (simplify_shift_const): Remove extra semicolon.Finn Hakansson1999-09-021-1/+1
| | | | | | | | | | * combine.c (simplify_shift_const): Remove extra semicolon. * dwarf2out.c (remove_AT): Likewise. * expmed.c (expand_mult): Likewise. * gcov.c (create_program_flow_graph): Likewise. * reorg.c (mostly_true_jump): Likewise. From-SVN: r29050
* Fix for 'Deadly optimization bug' (see egcs mailing list archive)Bernd Schmidt1999-08-271-0/+5
| | | | From-SVN: r28928
* combine.c (nonzero_bits): Allow single-ly set registers to be anywere in the ↵Gavin Romig-Koch1999-08-251-11/+28
| | | | | | | | | | | | | function only if... * combine.c (nonzero_bits) : Allow single-ly set registers to be anywere in the function only if they are pseudos and set before being used (not live at the start of the function). (num_sign_bit_copies) : Same. (get_last_value_validate) : Same. (get_last_value) : Same. From-SVN: r28871
* Warning fixes:Kaveh R. Ghazi1999-08-251-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * calls.c (emit_call_1): Mark parameter `stack_size' with ATTRIBUTE_UNUSED. (expand_call): Initialize variable `insn'. (emit_library_call): Likewise for variable `high_to_save'. (emit_library_call_value): Likewise. (store_one_arg): Likewise for variables `lower_bound' and `upper_bound'. * combine.c (try_combine): Likewise for variables `i2_code_number' and `other_code_number'. (find_split_point): Likewise for variables `pos', `unsignedp' and `inner'. (simplify_if_then_else): Likewise for variables `op' and `c1'. (simplify_and_const_int): Remove unused variable `width'. (merge_outer_ops): Likewise. * cse.c (simplify_binary_operation): Cast an INTVAL() to `unsigned HOST_WIDE_INT' when comparing against one. (simplify_relational_operation): Likewise. (cse_insn): Initialize variables `src_eqv_volatile', `src_eqv_in_memory', `src_eqv_in_struct', `src_eqv_hash' and `sets'. * final.c (init_final): Constify parameter `filename'. (final_start_function): Mark parameter `optimize' with ATTRIBUTE_UNUSED. (profile_function): Likewise for parameters `first' and `optimize'. (output_source_line): Likewise for parameter `file'. * integrate.c (subst_constants): Cast a value to `size_t' when comparing against one. (mark_stores): Initialize variable `mode'. Cast a value to `size_t' when comparing against one. * integrate.h (MAYBE_EXTEND_CONST_EQUIV_VARRAY): Likewise. * loop.c (move_movables): Initialize variable `first'. (strength_reduce): Likewise for variable `increment'. (check_dbra_loop): Likewise for variable `comparison_val'. Cast a value to `size_t' when comparing against one. (load_mems): Initialize variable `end_label'. * output.h (init_final): Constify parameter. * reload.c (decompose): Initialize variable `base'. * reload1.c (reload): Likewise for variable `is_scalar'. (spill_hard_reg): Mark parameter `dumpfile' with ATTRIBUTE_UNUSED. (choose_reload_regs): Initialize variable `mode'. (emit_reload_insns): Likewise for variable `store_insn'. (reload_cse_noop_set_p): Mark parameter `insn' with ATTRIBUTE_UNUSED. (reload_combine): Initialize variable `set'. * unroll.c (unroll_loop): Likewise for variable `local_label'. (copy_loop_body): Cast a value to `size_t' when comparing against one. * varasm.c (assemble_variable): Initialize variable `size_tree'. (const_hash): Add an `else abort()' in an if-else-if-else sequence. (remove_from_pending_weak_list): Mark parameter `name' with ATTRIBUTE_UNUSED. From-SVN: r28860
* rtl.h (rtx_format): Constify a char*.Kaveh R. Ghazi1999-08-201-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rtl.h (rtx_format): Constify a char*. * rtl.c (rtx_format): Likewise. (copy_rtx, copy_most_rtx, read_rtx): Likewise. (init_rtl): Use accessor macro, not `rtx_format'. * alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a char*. * caller-save.c (mark_referenced_regs): Likewise. * combine.c (subst, make_compound_operation, known_cond, gen_rtx_combine, update_table_tick, get_last_value_validate, use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise. * cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p, refers_to_p, canon_reg, fold_rtx, cse_process_notes, count_reg_usage): Likewise. * emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags): Likewise. * final.c (leaf_renumber_regs_insn): Likewise. * flow.c (mark_used_regs, find_use_as_address, dump_flow_info, dump_edge_info, count_reg_references): Likewise. * function.c (fixup_var_refs_1, walk_fixup_memory_subreg, fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1): Likewise. * gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p, oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs, add_label_notes): Likewise. * genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask, clear_struct_flag, count_sub_rtxs, count_alternatives, compares_alternatives_p, contained_in_p, walk_attr_value, write_expr_attr_cache): Likewise. * genconfig.c (walk_insn_part): Likewise. * genemit.c (max_operand_1, gen_exp): Likewise. * genextract.c (walk_rtx): Likewise. * genflags.c (num_operands): Likewise. * genoutput.c (scan_operands): Likewise. * genpeep.c (match_rtx): Likewise. * genrecog.c (add_to_sequence): Likewise. * haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths): Likewise. * integrate.c (save_constants, copy_for_inline, copy_rtx_and_substitute, subst_constants, restore_constants): Likewise. * jump.c (mark_jump_label, invert_exp, redirect_exp, rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise. * local-alloc.c (contains_replace_regs, memref_referenced_p): Likewise. * loop.c (record_excess_regs, rtx_equal_for_loop_p, add_label_notes, replace_call_address, count_nonfixed_reads, invariant_p, find_single_use_in_loop, find_mem_givs, find_life_end, maybe_eliminate_biv_1, update_reg_last_use): Likewise. * print-rtl.c (reg_names, print_rtx): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1): Likewise. * reg-stack.c (stack_regs_mentioned_p, record_label_references, record_reg_life_pat, swap_rtx_condition, goto_block_pat, print_blocks): Likewise. * regclass.c (fix_register, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (stable_but_for_p): Likewise. * reload.c (loc_mentioned_in_p, operands_match_p, find_reloads_toplevsubst_reg_equivs, find_reloads_address_1, copy_replacements, refers_to_regno_for_reload_p, refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p, reload_when_needed_name, reg_class_names, debug_reload_to_stream): Likewise. * reload1.c (eliminate_regs, scan_paradoxical_subregs, delete_address_reloads_1, count_occurrences, reload_cse_mem_conflict_p, reload_combine_note_use, add_auto_inc_notes): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p, reg_mentioned_p, regs_set_between_p, modified_between_p, modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p, rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p, may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs, jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise. * sched.c (sched_analyze_2, attach_deaths): Likewise. * stupid.c (stupid_mark_refs): Likewise. * unroll.c (remap_split_bivs): Likewise. * varasm.c (mark_constants): Likewise. * a29k/a29k.c (uses_local_reg_p): Likewise. * alpha/alpha.c (summarize_insn): Likewise. * arm/arm.c (symbol_mentioned_p, label_mentioned_p, eliminate_lr2ip): Likewise. * arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise. * i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx, reg_mentioned_in_mem): Likewise. * ns32k/ns32k.c (global_symbolic_reference_mentioned_p, symbolic_reference_mentioned_p): Likewise. * romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise. * sh/sh.c (regs_used, mark_use): Likewise. * vax/vax.c (vax_rtx_cost): Likewise. From-SVN: r28784
* * combine.c (distribute_notes): Handle REG_EH_RETHROW.Andreas Schwab1999-08-171-2/+3
| | | | From-SVN: r28743
* Include function.h in most files.Bernd Schmidt1999-08-091-0/+1
| | | | | | | | | Include function.h in most files. Remove most of the global variables duplicated in function.h. Add accessor macros for them which access current_function. Delete INLINE_HEADER rtx and related code, replace with code using struct function to store inlining related data. From-SVN: r28626
* Optimize duplicate zero_extend operations.Jim Wilson1999-08-021-2/+5
| | | | | | | * combine.c (force_to_mode, case LSHIFTRT): Add goto shiftrt. (force_to_mode, case ASHIFTRT): Add shiftrt label. From-SVN: r28424
* explow.c (trunc_int_for_mode): New function.Richard Henderson1999-07-221-43/+6
| | | | | | | | | | | | | | * explow.c (trunc_int_for_mode): New function. (plus_constant_wide): Use it. * combine.c (simplify_and_const_int): Likewise. (merge_outer_ops): Likewise. (simplify_shift_const): Likewise. * cse.c (simplify_unary_operation): Likewise. (simplify_binary_operation): Likewise. * emit-rtl.c (operand_subword): Likewise. * rtl.h: Declare it. From-SVN: r28222
* Patch from David Mosberger to fix 32 host cross 64 target bug.David Mosberger1999-06-141-1/+6
| | | | | | | | * combine.c (simplify_logical, case AND): Only call simplify_and_const_int if the mode is no wider than HOST_WIDE_INT or the constant is positive. From-SVN: r27517