Commit Graph

617 Commits

Author SHA1 Message Date
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Geoffrey Keating 16823694d5 Index: gcc/ChangeLog
2002-12-02  Geoffrey Keating  <geoffk@apple.com>

	* combine.c (combine_simplify_rtx): Add new canonicalizations.
	* doc/md.texi (Insn Canonicalizations): Document new
	canonicalizations for multiply/add combinations.
	* config/rs6000/rs6000.md: Add and modify floating add/multiply
	patterns to ensure they're used whenever they can be.

Index: gcc/testsuite/ChangeLog
2002-12-02  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/ppc-fmadd-1.c: New file.
	* gcc.dg/ppc-fmadd-2.c: New file.
	* gcc.dg/ppc-fmadd-3.c: New file.

From-SVN: r59841
2002-12-05 01:05:13 +00:00
Jakub Jelinek bc02f8d3f7 combine.c (force_to_mode): Only replace with (not Y) if all bits in fuller_mask (not just mask) are set in C.
* combine.c (force_to_mode): Only replace with (not Y) if all bits in fuller_mask
	(not just mask) are set in C.

	* gcc.c-torture/execute/20021118-3.c: New test.

From-SVN: r59295
2002-11-20 10:43:20 +01:00
Aldy Hernandez cff9f8d509 hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New.
2002-11-04  Aldy Hernandez  <aldyh@redhat.com>

	* hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New.

	* config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove.
	(CLASS_CANNOT_CHANGE_MODE): Remove.
	(CANNOT_CHANGE_MODE_CLASS): New.

	* config/alpha/alpha.h: Same.

	* config/ia64/ia64.h: Same.

	* config/mips/mips.h: Same.

	* config/s390/s390.h: Same.

	* config/sh/sh.h: Same.

	* config/pa/pa64-regs.h: Same.

	* config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype.

	* config/sh/sh.c (sh_cannot_change_mode_class): New.

	* config/mips/mips-protos.h (mips_cannot_change_mode_class): Add
	prototype.

	* config/mips/mips.c (mips_cannot_change_mode_class): New.

	* doc/tm.texi (Register Classes): Remove
	CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P.
	Document CANNOT_CHANGE_MODE_CLASS.

	* reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS.
	(push_reload): Same.

	* simplify-rtx.c (simplify_subreg): Same.

	* reload1.c (choose_reload_regs): Same.

	* recog.c (register_operand): Same.

	* regrename.c (mode_change_ok): Change to use new
	CANNOT_CHANGE_MODE_CLASS infrastructure.

	* regclass.c (cannot_change_mode_set_regs): New.
	Declare subregs_of_mode.
	(regclass): Use subregs_of_mode.
	Remove references to reg_changes_mode.
	(init_reg_sets_1): Remove class_can_change_mode and
	reg_changes_mode code.
	(invalid_mode_change_p): New.
	(dump_regclass): Use invalid_mode_change_p instead of
	class_can_change_mode.
	(regclass): Same.
	(record_operand_costs): Do not set reg_changes_mode.

	* local-alloc.c (struct qty): Remove changes_mode field.
	(alloc_qty): Remove changes_mode initialization.
	(update_qty_class): Remove set of changes_mode.
	(find_free_reg): Use subregs_of_mode.

	* global.c (find_reg): Use subregs_of_mode info.

	* rtl.h (cannot_change_mode_set_regs): New prototype.
	(invalid_mode_change_p): Same.
	(REG_CANNOT_CHANGE_MODE_P): New macro.

	* flow.c (mark_used_regs): Calculate subregs_of_mode.  Remove
	REG_CHANGES_MODE.
	(life_analysis): Clear subregs_of_mode.

	* combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P.
	Remove use of CLASS_CANNOT_CHANGE_MODE.
	(simplify_set): Same.
	(gen_lowpart_for_combine): Calculate subregs_of_mode.  Remove
	REG_CHANGES_MODE.

	* regs.h: Add extern for subregs_of_mode;
	Include hard-reg-set and basic-block.
	(REG_CHANGES_MODE): Delete.

From-SVN: r58794
2002-11-04 16:58:39 +00:00
Kazu Hirata 3eae4643be combine.c: Fix comment formatting.
* combine.c: Fix comment formatting.
	* loop.c: Likewise.
	* real.c: Likewise.
	* regclass.c: Likewise.
	* regmove.c: Likewise.
	* regrename.c: Likewise.
	* reg-stack.c: Likewise.
	* reload1.c: Likewise.
	* reload.c: Likewise.
	* reload.h: Likewise.
	* unroll.c: Likewise.

From-SVN: r58583
2002-10-27 14:47:55 +00:00
Roger Sayle dbf4f1a2ba * combine.c (simplify_set): Treat MODE_CC registers like cc0.
From-SVN: r58148
2002-10-15 05:01:07 +00:00
Richard Henderson ccf7aef428 combine.c (force_to_mode): Handle FLOAT_MODE destinations for CONST_INT.
* combine.c (force_to_mode): Handle FLOAT_MODE destinations
        for CONST_INT.

From-SVN: r57634
2002-09-29 20:26:47 -07:00
Kazu Hirata 991b659243 builtins.def: Fix comment formatting.
* builtins.def: Fix comment formatting.
	* c-common.def: Likewise.
	* cfgcleanup.c: Likewise.
	* combine.c: Likewise.
	* gengtype.c: Likewise.
	* params.def: Likewise.
	* predict.def: Likewise.
	* rtl.def: Likewise.
	* stab.def: Likewise.
	* stor-layout.c: Likewise.
	* tree.def: Likewise.
	* config/darwin.c: Likewise.
	* config/darwin.h: Likewise.
	* config/dbxcoff.h: Likewise.
	* config/elfos.h: Likewise.
	* config/fp-bit.c: Likewise.
	* config/freebsd-spec.h: Likewise.
	* config/interix.h: Likewise.
	* config/libgloss.h: Likewise.
	* config/linux-aout.h: Likewise.
	* config/linux.h: Likewise.
	* config/lynx-ng.h: Likewise.
	* config/lynx.h: Likewise.
	* config/netbsd-aout.h: Likewise.
	* config/netbsd.h: Likewise.
	* config/netware.h: Likewise.
	* config/psos.h: Likewise.
	* config/ptx4.h: Likewise.

From-SVN: r57624
2002-09-29 13:16:44 +00:00
Igor Shevlyakov 855c3a2e32 combine.c (simplify_set): Don't call to force_to_mode if size of integer type is larger than...
* combine.c (simplify_set): Don't call to force_to_mode if size
        of integer type is larger than HOST_BITS_PER_WIDE_INT.

From-SVN: r57549
2002-09-26 14:15:26 -07:00
Kazu Hirata da7d830409 ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* ChangeLog.0: Likewise.
	* ChangeLog.1: Likewise.
	* ChangeLog.2: Likewise.
	* ChangeLog.3: Likewise.
	* ChangeLog.4: Likewise.
	* ChangeLog.5: Likewise.
	* ChangeLog.6: Likewise.
	* FSFChangeLog.10: Likewise.
	* FSFChangeLog.11: Likewise.
	* alias.c: Likewise.
	* basic-block.h: Likewise.
	* c-aux-info.c: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-decl.c: Likewise.
	* c-format.c: Likewise.
	* c-semantics.c: Likewise.
	* c-typeck.c: Likewise.
	* calls.c: Likewise.
	* cfganal.c: Likewise.
	* cfgloop.c: Likewise.
	* collect2.c: Likewise.
	* combine.c: Likewise.
	* conflict.c: Likewise.
	* cppexp.c: Likewise.
	* cppfiles.c: Likewise.
	* cpphash.h: Likewise.
	* cppinit.c: Likewise.
	* cpplex.c: Likewise.
	* cpplib.c: Likewise.
	* cpplib.h: Likewise.
	* cppmacro.c: Likewise.
	* cse.c: Likewise.

From-SVN: r57398
2002-09-22 02:03:17 +00:00
Jim Wilson a9b2f05974 Fix v850 ICE.
* combine.c (try_combine): When split an instruction pair, where the
	first has a sign_extend src, verify that the src and dest modes match.

From-SVN: r57371
2002-09-20 14:42:25 -07:00
Jim Wilson ff0765200c fix subreg optimization bug introduced 2002-05-25
fix subreg optimization bug introduced 2002-05-25
	* combine.c (simplify_set): When optimizing a subreg src with a
	cc0 dest, use GET_MODE (src) for mask instead of inner_mode.

From-SVN: r57323
2002-09-19 16:39:34 -07:00
Dale Johannesen 307f767b38 Remove creation of invalid subreg. PR 7705, 7339, 7720.
From-SVN: r57315
2002-09-19 18:54:56 +00:00
Roger Sayle f40f4c8ed1 combine.c (try_combine): Handle the case that undobuf.other_insn has been turned into a return or...
* combine.c (try_combine): Handle the case that undobuf.other_insn
	has been turned into a return or unconditional jump, by inserting
	a BARRIER if necessary.
	(simplify_set):  Test if a condition code setter has a constant
	comparison at compile time, if so convert this insn to a no-op move
	and update/simplify the condition code user (undobuf.other_insn).

From-SVN: r56955
2002-09-08 18:07:54 +00:00
Igor Shevlyakov ad9df12ff5 combine.c (simplify_shift_const): Calculate rotate count correctly for vector operands.
* combine.c (simplify_shift_const): Calculate rotate count
        correctly for vector operands.

From-SVN: r56928
2002-09-07 20:34:16 -07:00
J"orn Rennecke b10f218708 combine.c (make_compound_operation): Don't generate zero / sign extensions in floating point modes.
* combine.c (make_compound_operation): Don't generate zero / sign
	extensions in floating point modes.

From-SVN: r56804
2002-09-04 18:49:58 +01:00
Geoffrey Keating 71012d9720 machmode.h (SCALAR_INT_MODE_P): New macro to test for scaler integer mode (MODE_INT or MODE_PARTIAL_INT).
* machmode.h (SCALAR_INT_MODE_P): New macro to test for
	scaler integer mode (MODE_INT or MODE_PARTIAL_INT).
	* explow.c (trunc_int_for_mode): Abort when the mode is not
	a scaler integer mode.
	* combine.c (expand_compound_operation): Don't expand Vector
	or Complex modes into shifts.
	(expand_field_assignment): Don't do bitwise arithmatic and
	shifts on Vector or Complex modes.
	(simplify_comparison): Don't call trunc_int_for_mode
	for VOIDmode.
	* recog.c (general_operand): Likewise.
	(immediate_operand): Likewise.
	(nonmemory_operand): Likewise.

Co-Authored-By: Steve Ellcey <sje@cup.hp.com>

From-SVN: r56443
2002-08-19 18:18:12 +00:00
Toon Moene 73e42cf342 c-common.c (cb_register_builtins): Set __FINITE_MATH_ONLY__ to 1 if -ffinite-math-only is given, and to 0 otherwise.
2002-08-01  Toon Moene  <toon@moene.indiv.nluug.nl>

	* c-common.c (cb_register_builtins): Set
	__FINITE_MATH_ONLY__ to 1 if -ffinite-math-only
	is given, and to 0 otherwise.
	* combine.c (simplify_if_then_else): HONOR_NANS
	implies FLOAT_MODE_P.

From-SVN: r55932
2002-08-01 09:08:38 +00:00
Toon Moene 2e8f2e8f7d flags.h: Declare flag_finite_math_only.
2002-07-30  Toon Moene  <toon@moene.indiv.nluug.nl>

	* flags.h: Declare flag_finite_math_only.
	Use it in definition of HONOR_NANS and
	HONOR_INFINITIES.
	* c-common.c (cb_register_builtins): Emit
	__FINITE_MATH_ONLY__ when flag_finite_math_only
	is set.
	* combine.c (simplify_if_then_else): If
	flag_finite_math_only is set, a == b has a
	definite value.
	* toplev.c: Initialize flag_finite_math_only.
	(set_flags_fast_math): Set it on -ffast-math.
	(flag_fast_math_set_p): Test it.
doc:
	* invoke.texi: Document -ffinite-math-only.
f:
	* com.c (ffe_init_options): Set
	flag_finite_math_only.
	* invoke.texi: Document -fno-finite-math-only.

From-SVN: r55887
2002-07-30 22:23:26 +00:00
J"orn Rennecke 25c2594701 combine.c (try_combine): When converting a paradoxical subreg to an extension...
* combine.c (try_combine): When converting a paradoxical subreg
	to an extension, take LOAD_EXTEND_OP into account.

From-SVN: r55404
2002-07-11 22:03:51 +01:00
Roger Sayle 0e603223a0 re PR c/2454 (Test Program A0376972.c fails with gcc-20010320, works with gcc-2.95.3)
PR c/2454
	* combine.c (nonzero_bits): LOAD_EXTEND_OP should only apply
	to SUBREGs of MEMs.  (num_sign_bit_copies): Likewise.

From-SVN: r55386
2002-07-11 01:23:07 +00:00
J"orn Rennecke 80ba02b10c combine.c (gen_lowpart_for_combine): Handle vector modes.
* combine.c (gen_lowpart_for_combine): Handle vector modes.
	Supply non-VOID mode to simplify_gen_subreg.

From-SVN: r55375
2002-07-10 19:51:20 +01:00
Roger Sayle 26c347808e combine.c (combine_simplify_rtx): Add an explicit cast to avoid signed/unsigned comparison warning.
* combine.c (combine_simplify_rtx): Add an explicit cast
	to avoid signed/unsigned comparison warning.
	(simplify_if_then_else): Likewise.
	(extended_count): Likewise.
	(simplify_shift_const): Likewise.
	(simplify_comparison): Likewise.

From-SVN: r55329
2002-07-08 15:59:53 +00:00
Roger Sayle 3129af4c94 combine.c (struct_undo): Change types of recorded substitutions to be either "int" or "rtx"...
* combine.c (struct_undo): Change types of recorded substitutions
	to be either "int" or "rtx", instead of "unsigned int" and "rtx".
	(do_SUBST_INT): Change types of the substitution from unsigned int
	to int, to avoid compilation warning from SUBST_INT's only caller.

	(make_extraction): Add cast to avoid compilation warning.
	(force_to_mode): Remove cast to avoid compilation warning.

From-SVN: r55221
2002-07-03 21:00:23 +00:00
Stephen Clarke f1b1186f6c combine.c (combine_simplify_rtx): Pass the mode of the shift count...
* combine.c (combine_simplify_rtx): Pass the mode of the
        shift count, not the shift operation when trying to simplify
        a shift on a SHIFT_COUNT_TRUNCATED target.

From-SVN: r55085
2002-06-28 15:34:47 -06:00
Richard Sandiford 988ef418eb * combine.c (make_extraction): Reapply to the argument of an ASHIFT.
From-SVN: r54846
2002-06-20 18:04:00 +00:00
Jan Hubicka b0dd480873 * combine.c (subst): Be prepared for simplify_subreg to return VOIDmode.
From-SVN: r54839
2002-06-20 15:39:58 +00:00
David S. Miller 2f937369fa Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05  David S. Miller  <davem@redhat.com>

	Delete SEQUENCE rtl usage outside of reorg and ssa passes.
	* rtl.h (gen_sequence, emit_insns, emit_insns_before,
	emit_insns_before_scope, emit_insns_after,
	emit_insns_after_scope): Delete declaration.
	* ada/misc.c (insert_code_for): Use emit_insn* instead of
	emit_insns_foo.
	* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
	(alpha_set_memflags): Fix comment.
	(set_frame_related_p): Use get_insns instead of gen_sequence.
	* config/alpha/alpha.md (setjmp receiver splitter): Avoid
	emitting no insns.
	* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
	gen_sequence.
	(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
	* config/fr30/fr30.c (fr30_move_double): Likewise.
	* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
	Likewise.
	* config/ia64/ia64.c (spill_restore_mem): Likewise.
	* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
	no insns.
	* config/m32r/m32r.c (gen_split_move_double): Use get_insns
	instead of gen_sequence.
	* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
	(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
	* config/sh/sh.c (sh_need_epilogue): Likewise.
	* config/sparc/sparc.md (current_function_calls_alloca, flat): New
	attributes.
	(setjmp pattern and split): Use them to avoid splitter which emits
	no RTL.
	* genattrtab.c (main): Emit include of function.h
	* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
	get_insns instead of gen_sequence.
	* config/cris/cris.c (cris_split_movdx): Likewise.
	* emit-rtl.c (emit_insns*): Kill.
	(try_split): Expect insn list instead of SEQUENCE.
	(make_jump_insn_raw, make_call_insn_raw): Fix comments.
	(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
	Make them abort if a SEQUENCE is given and RTL checking is
	enabled.
	(emit_*_scope): Don't forget to set scope on final insn.
	(gen_sequence): Move from here...
	* ssa.c (gen_sequence): To here as private function.
	* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
	comments.
	(expand_builtin_return, expand_builtin_mathfn): Likewise.
	(expand_builtin_strlen): Use get_insns instead of gen_sequence.
	(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
	(expand_builtin_expect_jump): Use get_insns and fix comments.
	* calls.c (try_to_integrate): Use emit_insn_foo.
	(expand_call, emit_library_call_value_1): Likewise.
	* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
	(emit_move_insn_1): Use get_insns instead of gen_sequence.
	(expand_expr): Use emit_insn_foo.
	* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
	* except.c (build_post_landing_pads): Likewise.
	* flow.c (attempt_auto_inc): Likewise.
	* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
	expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
	* function.c (fixup_var_refs_insn): Use get_insns instead of
	gen_sequence.
	(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
	(fixup_memory_subreg): Use get_insns instead of gen_sequence.
	(fixup_stack_1, purge_addressof_1, expand_main_function,
	get_arg_pointer_save_area): Likewise.
	(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
	expand_function_end): Use emit_insn_foo.
	(record_insns, keep_stack_depressed): Work with insn list instead
	of SEQUENCE, fix comments.
	* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
	noce_try_store_flag_constants, noce_try_store_flag_inc,
	noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
	noce_try_minmax, noce_try_abs): Use emit_insn_foo.
	(noce_process_if_block): Use get_insns instead of gen_sequence.
	* optabs.c (add_equal_note): Work with insn list, fix comments.
	(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
	(expand_unop, expand_complex_abs, expand_unop_insn,
	expand_no_conflict_block): Likewise.
	(gen_move_insn): Use get_insns instead of gen_sequence.
	(gen_cond_trap): Likewise.
	* integrate.c (copy_rtx_and_substitute): Likewise.
	(emit_initial_value_sets): Use emit_insn_foo.
	* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
	(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
	now that RTL generators give insn lists.
	* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
	* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
	instead of gen_sequence.
	(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
	* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
	instead of gen_sequence.
	* loop.c (move_movables, emit_prefetch_instructions,
	gen_add_mult, check_dbra_loop, gen_load_of_final_value):
	Likewise.
	(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
	(product_cheap_p): Likewise, and add commentary about RTL wastage
	here.
	* lcm.c (optimize_mode_switching): Use get_insns instead of
	gen_sequence.
	* profile.c (gen_edge_profiler): Likewise.
	* regmove.c (copy_src_to_dest): Likewise.
	* reg-stack.c (compensate_edge): Likewise and fix comment.
	* gcse.c (process_insert_insn): Likewise.
	(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
	* jump.c (delete_prior_computation): Update comment.
	* genemit.c (gen_expand, gen_split, main): Use get_insns instead
	of gen_sequence, update comments to match.
	* recog.c (peephole2_optimize): Work with insn lists instead of
	SEQUENCE rtl.
	* sched-vis.c (print_pattern): Abort on SEQUENCE.
	* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
	Use get_insns instead of gen_sequence.
	(copy_loop_body): Likewise and don't emit dummy NOTE.
	* genrecog.c: Don't mention SEQUENCE rtl in comments.
	* combine.c (try_combine): Expect insn lists from split generator.
	* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
	hand.

From-SVN: r54497
2002-06-11 05:22:48 -07:00
Jakub Jelinek 156755acc0 re PR rtl-optimization/6842 (internal compiler error using MMX intrinsics with optimization)
PR optimization/6842
	* combine.c (combine_simplify_rtx) [SUBREG]: Don't ICE if VOIDmode
	operand subreg cannot be simplified.

	* gcc.dg/20020531-1.c: New test.

From-SVN: r54462
2002-06-10 23:47:45 +02:00
Jeff Law e50126e858 emit-rtl.c (init_emit): Add hard registers to regno_reg_rtx.
* emit-rtl.c (init_emit): Add hard registers to regno_reg_rtx.
	* combine.c (move_deaths): Use regno_reg_rtx for hard regs rather
	than creating a new register.
	(distribute_notes): Likewise.
	* df.c (df_reg_use_gen): Likewise.
	(df_reg_clobber_gen): Likewise.
	(df_ref_record): Likewise.
	* expr.c (use_regs): Likewise.
	* flow.c (propagate_one_insn): Likewise.
	(mark_set_1): Likewise.
	(mark_used_reg): Likewise.
	* reload.c (emit_reload_insns): Likewise.

From-SVN: r54358
2002-06-07 19:51:22 -06:00
Jan Hubicka ba4f7968b5 loop.c (emit_prefetch_instructions): Properly place the address computation.
* loop.c (emit_prefetch_instructions): Properly place the address computation.


	* basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill.
	(set_block_for_insn): Turn into macro.
	* cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn.
	* cfglayout.c (insn_scopes): Kill.
	(scope_to_insns_initialize): Do not use insn_scopes.
	(scope_to_insns_finalize): Likewise.
	(duplicate_insn_chain): Likewise.
	(cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes.
	* cfgrtl.c (basic_block_for_insn): Kill.
	(delete_insn_and_edges, delete_insn_chain_and_edges): Simplify.
	(create_basic_block_structure): Use reorder_insns.
	(compute_bb_for_insn): Do not use basic_block_for_insn.
	(merge_blocks_nomove): Likewise.
	(update_bb_for_insn): Likewise.
	(verify_flow_info): Likewise.
	(set_block_for_insn): Kill.
	* combine.c (try_combine): Update gen_rtx_INSN call.
	* emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call.
	(mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear
	scopes and BBs.
	(add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify.
	(emit_note_before, emit_note_after, emit_line_note_after, emit_note):
	Clear BB.
	(emit_insns_after): Simplify.
	(emit_copy_of_insn_after): Copy scope.
	* final.c (final_start_function): Lower scopes.
	* flow.c (check_function_return_warnings): Do not rely on deleted insn.
	* integrate.c (copy_insn_list): Cope scopes.
	* jump.c (duplicate_loop_exit_test): LIkewise; simplify.
	* loop.c (loop_optimize): Do not care block notes.
	* print-rtl.c (print_rtx): Print BB.
	* recog.c (apply_change_group): Simplify.
	* rtl.c (copy_rtx): Handle 'B'.
	* rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields.
	* rtl.h (Field accessors): Update indexes.
	* sched-ebb.c (schedule_ebbs): Do not lower notes.
	* sched-rgn.c (schedule_insns): Likewise.
	* toplev.c (rest_of_compilation): Lower notes.
	* unroll.c (unroll_loop): Do not care scoping notes.
	(copy_loop_body): Copy scopes.

From-SVN: r54188
2002-06-02 21:09:54 +00:00
Zdenek Dvorak d55bc08175 basic-block.h (last_basic_block): Defined as synonym for n_basic_blocks.
* basic-block.h (last_basic_block): Defined as synonym for
	n_basic_blocks.
	* cfganal.c (mark_dfs_back_edges, flow_reverse_top_sort_order_compute,
	flow_depth_first_order_compute, flow_preorder_transversal_compute,
	flow_dfs_compute_reverse_init): Replaced relevant occurences of
	n_basic_blocks with last_basic_block.
	* cfgbuild.c (make_edges): Likewise.
	* cfgloop.c (flow_loop_scan, flow_loops_find): Likewise.
	* cfgrtl.c (verify_flow_info, purge_all_dead_edges): Likewise.
	* combine.c (combine_instructions): Likewise.
	* df.c (df_alloc, df_analyse_1, df_analyse, iterative_dataflow_sbitmap,
	iterative_dataflow_bitmap): Likewise.
	* dominance.c (init_dom_info, calc_dfs_tree_nonrec, calc_dfs_tree,
	calc_idoms, idoms_to_doms): Likewise.
	* flow.c (update_life_info_in_dirty_blocks, free_basic_block_vars):
	Likewise.
	* gcse.c (gcse_main, alloc_gcse_mem, compute_local_properties,
	compute_hash_table, expr_reaches_here_p, one_classic_gcse_pass,
	one_cprop_pass, compute_pre_data, pre_expr_reaches_here_p,
	one_pre_gcse_pass, compute_transpout, delete_null_pointer_checks_1,
	delete_null_pointer_checks, compute_code_hoist_vbeinout,
	hoist_expr_reaches_here_p, hoist_code, one_code_hoisting_pass,
	compute_store_table, build_store_vectors): Likewise.
	* haifa-sched.c (sched_init): Likewise.
	* ifcvt.c (if_convert): Likewise.
	* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
	pre_edge_lcm, compute_available, compute_nearerout,
	compute_rev_insert_delete, pre_edge_rev_lcm, optimize_mode_switching):
	Likewise.
	* predict.c (estimate_probability, process_note_prediction,
	note_prediction_to_br_prob): Likewise.
	* profile.c (GCOV_INDEX_TO_BB, BB_TO_GCOV_INDEX): Likewise.
	* recog.c (split_all_insns, peephole2_optimize): Likewise.
	* regrename.c (copyprop_hardreg_forward): Likewise.
	* resource.c (init_resource_info): Likewise.
	* sched-rgn.c (build_control_flow, find_rgns, compute_trg_info,
	init_regions, schedule_insns): Likewise.
	* ssa-ccp.c (ssa_const_prop): Likewise.
	* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
	* ssa.c (compute_dominance_frontiers,
	compute_iterated_dominance_frontiers, convert_to_ssa): Likewise.

	* df.c (df_refs_unlink): Fix FOR_EACH_BB usage (in #if 0'ed code)
	* gcse.c (alloc_rd_mem, alloc_avail_expr_mem): Use n_blocks for vector
	sizes consistently.

From-SVN: r53924
2002-05-27 13:45:44 +00:00
Andreas Jaeger 9b89393b82 combine.c (combine_instructions): Do not indent #if for traditional C.
* combine.c (combine_instructions): Do not indent #if for
	traditional C.

From-SVN: r53891
2002-05-26 10:03:42 +02:00
Kazu Hirata 8c1d52a397 * combine.c (simplify_set): Remove an unnecessary subreg.
From-SVN: r53873
2002-05-25 19:47:11 +00:00
Zdenek Dvorak e0082a7265 bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
	Use FOR_EACH_BB macros to iterate over basic block chain.
	* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
	alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
	Likewise.
	* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
	find_unreachable_blocks, create_edge_list, verify_edge_list,
	remove_fake_edges, add_noreturn_fake_exit_edges,
	flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
	Likewise.
	* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
	find_sub_basic_blocks): Likewise.
	* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
	Likewise.
	* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
	Likewise.
	* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
	Likewise.
	* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
	commit_edge_insertions, commit_edge_insertions_watch_calls,
	print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
	* combine.c (combine_instructions, reg_dead_at_p): Likewise.
	* conflict.c (conflict_graph_compute): Likewise.
	* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
	df_modified_p, df_refs_unlink, df_dump): Likewise.
	* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
	* final.c (compute_alignments): Likewise.
	* flow.c (update_life_info, update_life_info_in_dirty_blocks,
	delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
	count_or_remove_death_notes): Likewise.
	* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
	compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
	classic_gcse, compute_transp, cprop, compute_pre_data,
	compute_transpout, invalidate_nonnull_info,
	delete_null_pointer_checks_1, delete_null_pointer_checks,
	compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
	compute_store_table, build_store_vectors, store_motion): Likewise.
	* global.c (global_conflicts, mark_elimination): Likewise.
	* graph.c (print_rtl_graph_with_bb): Likewise.
	* haifa-sched.c (sched_init): Likewise.
	* ifcvt.c (if_convert): Likewise.
	* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
	compute_available, compute_nearerout, compute_rev_insert_delete,
	optimize_mode_switching): Likewise.
	* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
	* predict.c (estimate_probability, note_prediction_to_br_prob,
	propagate_freq, counts_to_freqs, expensive_function_p,
	estimate_bb_frequencies): Likewise.
	* profile.c (instrument_edges, get_exec_counts,
	compute_branch_probabilities, compute_checksum, branch_prob,
	find_spanning_tree): Likewise.
	* recog.c (split_all_insns, peephole2_optimize): Likewise.
	* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
	Likewise.
	* regclass.c (scan_one_insn, regclass): Likewise.
	* regmove.c (mark_flags_life_zones, regmove_optimize,
	record_stack_memrefs): Likewise.
	* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
	* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
	* resource.c (find_basic_block): Likewise.
	* sched-ebb.c (schedule_ebbs): Likewise.
	* sched-rgn.c (is_cfg_nonregular, build_control_flow,
	find_single_block_region, find_rgns, schedule_insns)
	* sibcall.c (optimize_sibling_and_tail_recursive_call)
	* ssa-ccp.c (optimize_unexecutable_edges,
	ssa_ccp_df_delete_unreachable_insns): Likewise.
	* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
	* ssa.c (find_evaluations, compute_dominance_frontiers_1,
	rename_block, convert_to_ssa, compute_conservative_reg_partition,
	compute_coalesced_reg_partition, rename_equivalent_regs,
	convert_from_ssa): Likewise.
	* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
	process_for_unwind_directive): Likewise.

	* df.c (FOR_ALL_BBS): Removed.
	* gcse.c (struct null_pointer_info): Type of current_block field
	changed.
	(struct reg_avail_info): Type of last_bb field changed.
	* config/ia64/ia64.c (block_num): Removed.
	(need_copy_state): Type changed.
	(last_block): New.

From-SVN: r53804
2002-05-23 19:23:51 +00:00
Jakub Jelinek 2dd36f90d8 combine.c (force_to_mode): Use gen_int_mode.
* combine.c (force_to_mode): Use gen_int_mode.
	Don't clear CONST_INT bits outside of mode.

	* gcc.dg/20020517-1.c: New test.

From-SVN: r53750
2002-05-22 23:35:56 +02:00
Zdenek Dvorak f6366fc7ad bb-reorder.c (make_reorder_chain_1): Modified.
* bb-reorder.c (make_reorder_chain_1): Modified.
	* cfganal.c (can_fallthru, flow_call_edges_add,
	flow_preorder_transversal_compute): Modified.
	* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
	find_sub_basic_blocks): Modified.
	* cfgcleanup.c (try_simplify_condjump, try_optimize_cfg): Modified.
	* cfglayout.c (skip_insns_after_block, fixup_reorder_chain,
	fixup_fallthru_exit_predecessor, cfg_layout_redirect_edge): Modified.
	* cfgrtl.c (tidy_fallthru_edges, verify_flow_info): Modified.
	* combine.c (this_basic_block): Type changed to basic_block.
	(combine_instructions, set_nonzero_bits_and_sign_copies, try_combine,
	nonzero_bits, num_sign_bit_copies, get_last_value_validate,
	get_last_value, distribute_notes, distribute_links): Modified.
	* final.c (compute_alignments): Modified.
	* flow.c (regno_uninitialized, regno_clobbered_at_setjmp): Modified.
	* function.c (thread_prologue_and_epilogue_insns): Modified.
	* gcse.c (compute_code_hoist_vbeinout): Modified.
	* global.c (build_insn_chain): Modified.
	* ifcvt.c (find_if_block, find_cond_trap): Modified.
	* predict.c (last_basic_block_p, note_prediction_to_br_prob): Modified.
	* regmove.c (regmove_optimize): Modified.
	* resource.c (find_basic_block): Modified.
	* sched-ebb.c (schedule_ebbs): Modified.
	* ssa-dce.c (find_control_dependence, find_pdom): Modified.

From-SVN: r53695
2002-05-21 20:37:43 +00:00
Dale Johannesen 4c11675d61 Back out my previous patch; causes bootstrap problem for Ada (86 Linux)
From-SVN: r53671
2002-05-20 18:20:45 +00:00
Richard Henderson 0b17ab2f5b Revert "Basic block renumbering removal", and two followup patches.
From-SVN: r53537
2002-05-16 19:31:56 -07:00
Dale Johannesen 63b827c591 Reenable combination of hard regs unless CLASS_LIKELY_SPILLED_P.
From-SVN: r53531
2002-05-16 21:30:48 +00:00
Zdenek Dvorak 355e4ec445 Basic block renumbering removal.
From-SVN: r53522
2002-05-16 10:34:53 -07:00
Zack Weinberg 5692c7bc60 emit-rtl.c (global_rtl): Update comment.
* emit-rtl.c (global_rtl): Update comment.
	(const_double_htab, const_double_htab_hash,
	const_double_htab_hash, lookup_const_double): New.
	(const_int_htab_hash, const_int_htab_eq): Remove const
	qualifiers, which cause tons of warnings with RTL checking on.
	(gen_rtx_CONST_DOUBLE): Deleted.
	(const_double_from_real_value): New function - bears some
	resemblance to the former immed_real_const_1.
	(immed_double_const): Moved here from varasm.c and
	simplified.
	(gen_rtx_REG): Make REGNO unsigned to squelch warnings.
	(gen_rtx_SUBREG): Use gen_rtx_raw_SUBREG.
	(gen_rtx): Use immed_double_const.
	(init_emit_once): Initialize the const_double_htab.  Use
	REAL_VALUE_FROM_INT where possible.  Can now use
	CONST_DOUBLE_FROM_REAL_VALUE when setting up const_tiny_rtx.
	* varasm.c (struct varasm_status): Remove x_const_double_chain.
	(const_double_chain, immed_real_const, clear_const_double_mem): Delete.
	(immed_double_const, immed_real_const_1): Moved to emit-rtl.c.
	(init_varasm_status, mark_varasm_status): Don't touch
	x_const_double_chain.

	* output.h: Delete prototype for clear_const_double_mem.
	* real.h: Make REAL_VALUE_TYPE a macro again.  Remove leading
	'0' slot from all CONST_DOUBLE_FORMAT definitions.  Prototype
	const_double_from_real_value, not immed_real_const_1, and use
	it to define CONST_DOUBLE_FROM_REAL_VALUE.  Define new macro
	CONST_DOUBLE_ATOF.
	* rtl.h (CONST_DOUBLE_CHAIN): Kill.
	(CONST_DOUBLE_LOW, CONST_DOUBLE_HIGH): Adjust.
	(gen_rtx_CONST_DOUBLE, immed_real_const): Delete prototypes.
	(gen_rtx_REG): Second arg is unsigned.

	* gengenrtl.c (special_rtx): Take out CONST_DOUBLE.
	(excluded_rtx): New, return true for CONST_DOUBLE.
	(genmacro): Write nothing for excluded codes.
	* combine.c (combine_simplify_rtx): Use CONST_DOUBLE_FROM_REAL_VALUE.
	* expr.c (expand_expr): Likewise.
	* ggc-common.c (ggc_mark_rtx_children_1): Don't mark the
	CONST_DOUBLE_CHAIN.
	* toplev.c (rest_of_compilation): Don't call
	clear_const_double_mem.

	* config/rs6000/rs6000.c (rs6000_float_const): Delete.
	(rs6000_hash_constant): Remove CONST_DOUBLE special case.
	(toc_hash_eq): Remove CONST_DOUBLE and LABEL_REF special cases.
	* config/rs6000/rs6000-protos.h: Don't prototype rs6000_float_const.
	* config/c4x/c4x.md, config/rs6000/rs6000.md: Use CONST_DOUBLE_ATOF.
	* config/dsp16xx/dsp16xx.md, config/mips/mips.md,
	config/pa/pa.md: Use CONST_DOUBLE_FROM_REAL_VALUE.
	* config/sparc/sparc.md, config/sparc/sparc.c: Use immed_double_const.

From-SVN: r53409
2002-05-13 04:50:20 +00:00
Kazu Hirata e0a2f70599 combine.c: Fix comment formatting.
* combine.c: Fix comment formatting.
	* expr.c: Likewise.
	* genautomata.c: Likewise.
	* stmt.c: Likewise.
	* tree.h: Likewise.

From-SVN: r53044
2002-05-02 13:55:35 +00:00
Franz Sirl da6886f66b combine.c (find_split_point): Use gen_int_mode.
2002-04-29  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>

	* combine.c (find_split_point): Use gen_int_mode.

From-SVN: r52916
2002-04-30 00:38:23 +00:00
Bernd Schmidt 2e676d7878 Prevent aborts taking a vector mode subreg of a constant integer
From-SVN: r52467
2002-04-18 11:29:19 +00:00
Jakub Jelinek 578fc63d14 re PR c/6223 (internal compiler error in Wine-20020310)
PR c/6223
	* combine.c (if_then_else_cond): Use trunc_int_for_mode on nz.

	* gcc.dg/20020411-1.c: New test.

From-SVN: r52176
2002-04-11 22:56:29 +02:00
Jeff Law 5add6d1a6d combine.c (simplify_comparison): Avoid narrowing a comparison with a paradoxical subreg when...
* combine.c (simplify_comparison): Avoid narrowing a comparison
	with a paradoxical subreg when doing so would drop signficant bits.

Co-Authored-By: Hans-Peter Nilsson <hp@bitrange.com>

From-SVN: r51785
2002-04-03 03:21:29 +00:00
Jakub Jelinek 30984c5791 re PR rtl-optimization/6086 (Reload misoptimizes DImode PREINC on PPC)
PR optimization/6086
	* combine.c (combine_simplify_rtx): If simplify_rtx failed because
	of SUBREG of volatile MEM or because the MEM was mode dependent,
	return CLOBBER instead of unmodified SUBREG.

From-SVN: r51606
2002-03-30 19:50:34 +01:00
Jakub Jelinek 0a0440c94f combine.c (set_nonzero_bits_and_sign_copies): Don't call nonzero_bits if not needed.
* combine.c (set_nonzero_bits_and_sign_copies): Don't call
	nonzero_bits if not needed.
	(nonzero_bits) [XOR]: Likewise.
	(nonzero_bits) [REG]: Use reg_last_set_nonzero_bits even if
	reg_last_set_mode and mode are both MODE_INT, but not equal.
	(record_value_for_reg): Compute reg_last_set_nonzero_bits
	in nonzero_bits_mode for MODE_INT modes.

From-SVN: r51551
2002-03-29 09:01:20 +01:00
Jeff Law 8bc528064f re PR rtl-optimization/3311 (GCC-SH: gcc loses result of AND operation due to force_to_mode bug)
* combine.c (simplify_and_const_int): Make sure to apply mask
	when force_to_mode returns a constant integer.  PR3311.

From-SVN: r51532
2002-03-28 16:33:52 -07:00