Commit Graph

110 Commits

Author SHA1 Message Date
Zdenek Dvorak 79771cc412 re PR rtl-optimization/14229 (20000504-1.c:15: error: missing barrier after block 1)
PR optimization/14229
	* cfgrtl.c (rtl_tidy_fallthru_edge): Do not fail for !onlyjump jump.

From-SVN: r78605
2004-02-28 09:51:56 +00:00
Richard Henderson c263766cf3 toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
        * bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
        cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
        config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
        config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
        loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
        ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
        toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
        s/rtl_dump_file/dump_file/g.

From-SVN: r78399
2004-02-24 15:40:03 -08:00
Jan Hubicka 66fd46b6c6 alias.c (record_set): Use hard_regno_nregs.
* alias.c (record_set): Use hard_regno_nregs.
	* bt-load.c (find_btr_reference, note_btr_set): Likewise.
	* builtins.c (apply_args_size): Likewise.
	* caller-save.c (setup_save_areas, save_call_clobbered_regs,
	mark_set_regs, add_stored_regs, mark_referenced_regs,
	insert_restore, insert_save, insert_one_insn): Likewise.
	* cfgcleanup.c: Include regs.h
	(mark_effect, mentions_nonequal_regs): Likewise.
	* cfgrtl.c (mark_killed_regs): Likewise
	* combine.c (update_table_tick, record_value_for_reg,
	record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p,
	reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths,
	reg_bitfield_target_p, distribute_notes): Likewise.
	* cse.c (mention_regs, insert, invalidate, invalidate_for_call,
	exp_equiv_p, cse_insn): Likewise.
	* cselib.c (cselib_lookup): Likewise.
	(cselib_invalidate_regno, cselib_record_set): Likewise.
	* df.c (df_ref_record): Likewise.
	* dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor):
	Likewise.
	* flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg,
	count_or_remove_death_notes_bb): Likewise.
	* function.c (aggregate_value_p, keep_stack_depressed): Likewise.
	* gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts,
	mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise.
	* integrate.c (mark_stores): Likewise.
	* jump.c (delete_prior_computation): Likewise.
	* lcm.c (reg_dies, reg_becomes_live): Likewise.
	* local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise.
	* loop.c (LOOP_REGNO_NREGS): Likewise.
	* postreload.c (reload_combine, reload_combine_note_store,
	reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise.
	* ra-colorize.c (combine, color_usable_p, get_free_reg,
	calculate_dont_begin, calculate_dont_begin, colorize_one_web,
	try_recolor_web, insert_coalesced_conflicts, check_colors,
	break_precolored_alias): Likewise.
	* ra-debug.c: Include regs.h
	(ra_print_rtx_object): Likewise.
	* ra-rewrite (choose_spill_colors): Likewise.
	(spill_same_color_p, update_spill_colors, spill_is_free): Likewise.
	* ra.c (init_ra): Likewise.
	* recog.c (reg_fits_class_p, peep2_reg_dead_p,
	peep2_find_free_register): Likewise.
	* reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise.
	* regclass.c (hard_regno_nregs): New array.
	(init_reg_modes_once): Initialize it.
	(choose_hard_reg_mode): Use it.
	(record_reg_classes): Likewise.
	* regmove.c (mark_flags_life_zones): Likewise.
	* regrename.c (note_sets, clear_dead_regs, regrename_optimize,
	scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno,
	copy_value, maybe_mode_change, find_oldest_value_reg,
	copyprop_hardreg_forward_1):
	* regs.h (hard_regno_nregs): Declare.
	* realod.c (reload_inner_reg_of_subreg): Use it.
	(push_reload, combine_reloads, find_dummy_reload,
	hard_reg_set_here_p, operands_match_p, decompose, find_reloads,
	refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p,
	reload_adjust_reg_for_mode): Likewise.
	* reload1.c (compute_use_by_pseudos, count_pseudo,
	count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live,
	spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use,
	clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p
	allocate_reload_reg, choose_reload_regs, emit_reload_insns,
	delete_output_reload): Likewise.
	* resource.c (update_live_status, mark_referenced_resources,
	mark_set_resources, mark_target_live_regs): Likewise.
	* rtlanal.c:  Include regs.h
	(refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p,
	dead_or_set_regno_p, find_regno_note, find_reg_fusage,
	subreg_regno_offset, subreg_offset_representable_p,
	hoist_test_store): Likewise.
	* sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise.
	* sched-rgn.c (check_live_1, update_live_1): Likewise.
	* stmt.c: Include regs.h
	(decl_conflicts_with_clobbers_p): Likewise.
	* varasm.c (make_decl_rtl): Likewise.
	* Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy.

From-SVN: r77088
2004-02-02 00:17:18 +00:00
Zdenek Dvorak f470c378ac Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency.
* Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency.
	* basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb,
	verify_flow_info): Declaration removed.
	* cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c.
	(debug_bb, debug_bb_n): Add argument to dump_bb call.
	* cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge,
	try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block
	instead of delete_block.
	* cfghooks.c: Include timevar.h and toplev.h.
	(cfg_hooks): Define here.
	(verify_flow_info, dump_bb): Moved from cfg.c.
	(redirect_edge_and_branch, redirect_edge_and_branch_force,
	split_block, split_block_after_labels, move_block_after,
	delete_basic_block, split_edge, create_basic_block,
	create_empty_bb, can_merge_blocks_p, merge_blocks,
	make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges):
	New functions.
	* cfghooks.h (struct cfg_hooks): Added fields name,
	make_forwarder_block, tidy_fallthru_edge and
	move_block_after. Changed type of verify_flow_info, dump_bb,
	split_block fields. Renamed cfgh_split_edge and delete_block
	fields.
	(redirect_edge_and_branch, redirect_edge_and_branch_force,
	split_block, delete_block, split_edge, create_basic_block,
	can_merge_blocks_p, merge_blocks): Macros removed.
	(cfg_hooks): Do not export.
	(verify_flow_info, dump_bb, redirect_edge_and_branch,
	redirect_edge_and_branch_force, split_block, split_block_after_labels,
	move_block_after, delete_basic_block, split_edge, create_basic_block,
	create_empty_bb, can_merge_blocks_p, merge_blocks,
	make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges):
	Declare.
	(cfg_layout_rtl_cfg_hooks): Declare.
	* cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch):
	New functions.
	(canonicalize_loop_headers): Use new semantics of make_forwarder_block.
	(redirect_edge_with_latch_update): Removed.
	(make_forwarder_block): Moved to cfghooks.c, semantics changed.
	* cfgloopmanip.c (remove_bbs): Do not update dominators here.
	* cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb,
	rtl_delete_block, rtl_split_block, rtl_merge_blocks,
	tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block,
	cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to
	cfghooks.c.
	(rtl_create_basic_block): Coding style fix.
	(rtl_tidy_fallthru_edge, rtl_move_block_after,
	rtl_make_forwarder_block): New functions.
	(update_cfg_after_block_merging): Removed.
	(rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries.
	* flow.c (verify_wide_reg, verify_local_live_at_start): Add argument
	to dump_bb.
	* ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1,
	find_if_case_2): Don't update dominators.
	* timevar.def (TV_CFG_VERIFY): New.
	* loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info.
	* cfglayout.c (copy_bbs): Don't call add_to_dominance_info.
	* cfgloopmanip.c (split_loop_bb): Don't update dominators.
	(remove_bbs): Don't call remove_bbs.
	(create_preheader): Use make_forwarder_block.
	(mfb_keep_just, mfb_update_loops): New static functions.

From-SVN: r76851
2004-01-29 07:47:56 +00:00
Kazu Hirata d9221e016b alias.c, [...]: Update copyright.
* alias.c, basic-block.h, c-common.c, c-common.h,
	c-cppbuiltin.c, c-opts.c, c-pragma.c, c-pretty-print.c,
	calls.c, cfg.c, cfgcleanup.c, cfgrtl.c, cgraph.h, collect2.c,
	combine.c, cppcharset.c, cpphash.h, cppinit.c, cpplib.c,
	cpplib.h, cppmacro.c, crtstuff.c, cselib.c, cselib.h,
	defaults.h, df.c, dominance.c, et-forest.c, expmed.c, expr.c,
	expr.h, fix-header.c, function.h, gcc.c, gcse.c, genattrtab.c,
	genautomata.c, genconditions.c, genemit.c, genflags.c,
	gengtype.c, gengtype.h, genopinit.c, genrecog.c, gensupport.c,
	ggc-zone.c, graph.c, haifa-sched.c, input.h, integrate.c,
	langhooks-def.h, langhooks.c, langhooks.h, line-map.c,
	line-map.h, local-alloc.c, optabs.c, optabs.h, postreload.c,
	ra.h, recog.c, reg-stack.c, regmove.c, reload.c, reorg.c,
	rtl.c, sched-deps.c, sched-ebb.c, sdbout.c, system.h,
	target.h, targhooks.c, toplev.h, tree-inline.c, unwind-pe.h,
	unwind.h, varray.c, varray.h: Update copyright.

From-SVN: r76302
2004-01-21 20:40:04 +00:00
Jan Hubicka 3348b696a8 basic-block.h (try_redirect_by_replacing_jump): Declare.
* basic-block.h (try_redirect_by_replacing_jump): Declare.
	* cfgcleanup.c (try_optimize_cfg): Use it.
	* cfgrtl.c (try_redirect_by_replacing_jump): Export.
	(rtl_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch):
	Kill hack.
	(cfg_layout_merge_blocks): Use try_redirect_by_replacing_jump.

	Revert:
	2004-01-16  Geoffrey Keating  <geoffk@apple.com>

		* cfgrtl.c (try_redirect_by_replacing_jump): Optimize tablejumps
		even after reload, just don't remove the actual jump tables.

From-SVN: r76115
2004-01-18 21:51:30 +00:00
Geoffrey Keating ab530ea8b8 cfgrtl.c (try_redirect_by_replacing_jump): Optimize tablejumps even after reload, just don't remove the actual jump tables.
* cfgrtl.c (try_redirect_by_replacing_jump): Optimize tablejumps
	even after reload, just don't remove the actual jump tables.

From-SVN: r76028
2004-01-17 07:46:49 +00:00
Jan Hubicka e24e721187 re PR rtl-optimization/11350 (undefined labels with -Os -fPIC)
PR opt/11350
        * cfgcleanup.c (try_optimize_cfg): Suppress tablejump removal
        after reload.
        * cfgrtl.c (rtl_can_merge_blocks, cfglayout_can_merge_blocks,
        rtl_try_redirect_by_replacing_branch): Likewise.

From-SVN: r75968
2004-01-16 03:30:48 -08:00
Jan Hubicka 432f982f5c re PR rtl-optimization/12826 (Optimizer removes reference through volatile pointer)
PR opt/12826
	* loop.c (insert_loop_mem): Preffer VOLATILE memory references to be
	stored.

	PR opt/12863
	* cfgcleanup.c (label_is_jump_target_p): Move to...
	* rtlanal.c (label_is_jump_target_p): ... here.
	* cfgrtl.c (cfg_layout_redirect_edge_and_branch):  Fix redirecting of fallthru
	edges unified with branch edges.

From-SVN: r75733
2004-01-12 16:32:12 +00:00
Steven Bosscher a813c11120 basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
2003-12-11  Steven Bosscher  <steven@gcc.gnu.org>

	* basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
	(BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
	(basic_block_def): Rename `head' to `head_' and `end' to `end_'.
	(BB_HEAD, BB_END): New accessor macros for the `head_' and `end_'
	fields of a basic block.
	* bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c,
	cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c,
	cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c,
	final.c, flow.c, function.c, gcse.c, global.c, graph.c,
	haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c,
	loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c,
	ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c,
	regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c,
	sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c,
	config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of
	accessing the `head' and `end' fields of a basic block directly.

	* gengtype.c: Add missing piece from earlier patch.  Dunno what
	I was thinking...

From-SVN: r74520
2003-12-11 00:20:51 +00:00
Josef Zlomek 9295a326c0 cfgrtl.c (delete_insn): Decrease LABEL_NUSES for all REG_LABEL notes.
PR/10239
	* cfgrtl.c (delete_insn): Decrease LABEL_NUSES for all REG_LABEL notes.

From-SVN: r73145
2003-10-31 14:19:03 +00:00
Josef Zlomek 5d693491f0 cfgrtl.c (try_redirect_by_replacing_jump): Move jump immediatelly before BARRIER.
PR/11640
	* cfgrtl.c (try_redirect_by_replacing_jump): Move jump
	immediatelly before BARRIER.

From-SVN: r73142
2003-10-31 14:09:34 +00:00
Eric Botcazou 0b75beaaaf re PR rtl-optimization/11646 (ICE in commit_one_edge_insertion with -fnon-call-exceptions -fgcse -O)
PR optimization/11646
	* cfgrtl.c (purge_dead_edges) [JUMP_INSN]: Rematerialize the
	EDGE_ABNORMAL flag for EH edges.
	* toplev.c (rest_of_handle_cse): Delete unreachable blocks
	if dead edges were purged.

From-SVN: r71455
2003-09-17 07:11:01 +00:00
Kazu Hirata beb235f896 c-decl.c: Fix comment formatting.
* c-decl.c: Fix comment formatting.
	* cfgrtl.c: Likewise.
	* combine.c: Likewise.
	* convert.c: Likewise.
	* dominance.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* expmed.c: Likewise.
	* fold-const.c: Likewise.
	* gcov.c: Likewise.
	* genattrtab.c: Likewise.
	* ggc-common.c: Likewise.
	* mips-tfile.c: Likewise.
	* regmove.c: Likewise.

From-SVN: r70677
2003-08-22 06:45:14 +00:00
Kaveh R. Ghazi 703ad42b4b alias.c [...]: Remove unnecessary casts.
* alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c
	c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in
	c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c
	collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c
	cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c
	cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c
	dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c
	fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c
	gcse.c genattr.c genattrtab.c genautomata.c genconditions.c
	genemit.c genextract.c genoutput.c genrecog.c gensupport.c
	ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c
	integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c
	loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c
	postreload.c prefix.c print-tree.c protoize.c ra-build.c
	ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c
	regmove.c regrename.c reload.c reload1.c reorg.c resource.c
	sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c
	simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c
	tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c
	varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary
	casts.

From-SVN: r69587
2003-07-19 14:47:15 +00:00
Zdenek Dvorak 65f43cdfee Makefile.in (ifcvt.o): Add cfgloop.h.
* Makefile.in (ifcvt.o): Add cfgloop.h.
	* basic-block.h (EDGE_LOOP_EXIT): New flag.
	* cfgrtl.c (rtl_verify_flow_info_1): Handle it correctly.
	* ifcvt.c: Include cfgloop.h.
	(mark_loop_exit_edges): New static function.
	(if_convert): Call it.
	(find_if_header): Ignore branches out of loops.

From-SVN: r69572
2003-07-18 22:52:05 +00:00
Richard Henderson 790199856a cfgrtl.c (force_nonfallthru_and_redirect): Use tablejump_p to skip the addr_vec.
* cfgrtl.c (force_nonfallthru_and_redirect): Use tablejump_p
        to skip the addr_vec.

From-SVN: r69569
2003-07-18 14:33:36 -07:00
Andreas Jaeger 5671bf2771 genextract.c: Convert remaining prototypes to ISO C90.
2003-07-07  Andreas Jaeger  <aj@suse.de>

	* genextract.c: Convert remaining prototypes to ISO C90.

	* cpplex.c (_cpp_free_buff): Convert prototype to ISO C90.
	* fold-const.c (fold_single_bit_test): Likewise.
	* diagnostic.c (default_diagnostic_finalizer): Likewise.
	* cfgrtl.c (rtl_redirect_edge_and_branch): Likewise.

	* gengtype.c (write_array): Generate ISO C90 prototypes.

	* genflags.c (gen_proto): Generate ISO C90 prototypes.


For cp:
2003-07-07  Andreas Jaeger  <aj@suse.de>

	* friend.c: Convert to ISO C90 prototypes.

	* Make-lang.in ($(srcdir)/cp/cfns.h): Use ANSI-C as output
	language.
	* cfns.h: Regenerate.

	* typeck.c: Convert remaining prototypes to ISO C90.
	* search.c: Likewise.

	* decl2.c (build_expr_from_tree): Convert prototype to ISO C90.
	* semantics.c (expand_or_defer_fn): Likewise
	* mangle.c (discriminator_for_string_literal): Likewise.
	* g++spec.c (lang_specific_driver): Likewise.

	* search.c (lookup_base_r): Remove unused variable.

From-SVN: r69050
2003-07-07 21:11:59 +02:00
Kazu Hirata 4d6922ee32 bt-load.c: Fix comment typos.
* bt-load.c: Fix comment typos.
	* c-incpath.c: Likewise.
	* cfg.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* diagnostic.h: Likewise.
	* dwarfout.c: Likewise.
	* emit-rtl.c: Likewise.
	* et-forest.c: Likewise.
	* et-forest.h: Likewise.
	* expr.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* jump.c: Likewise.
	* langhooks.h: Likewise.
	* local-alloc.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop-unswitch.c: Likewise.
	* ra-build.c: Likewise.
	* regclass.c: Likewise.
	* regmove.c: Likewise.
	* rtl.def: Likewise.
	* rtlanal.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* simplify-rtx.c: Likewise.
	* ssa.c: Likewise.
	* tracer.c: Likewise.
	* tree.c: Likewise.

From-SVN: r68975
2003-07-05 15:17:36 +00:00
Jan Hubicka bc35512f09 basic-block.h (create_basic_block, [...]): Kill.
* basic-block.h (create_basic_block, merge_blocks_nomove): Kill.
	* cfgcleanup.c (merge_blocks): Rename to merge_blocks_move.
	(merge_blocks_move_predecessor_nojumps,
	 merge_blocks_move_successor_nojumps): Use merge_blocks.
	(try_optimize_cfg): Use merge_blocks_move.
	* cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block.
	(merge_blocks_nomove): Rename to rtl_merge_blocks.
	(cfg_layout_create_basic_block): New.
	(rtl_can_merge_blocks): New.
	(cfg_layout_split_block): Do not alloc aux by hand.
	* cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p,
	merge_blocks.
	(create_basic_block, can_merge_blocks_p, merge_blocks): New macros.
	* cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand.
	* cfgloopmanip.c (loop_split_edge_with): Likewise.
	* ifcvt.c (merge_if_block): Use merge_blocks_nomove.

	* basic-block.h (basic_block_def): Add field 'rbi'.
	* bb-reorder.c (find_traces, rotate_loop, mark_bb_visited,
	find_traces_1_round, copy_bb, connect_traces): Update use of rbi.
	* cfg.c (entry_exit_blocks): Add new field.
	* cfglayout.c: Include alloc-pool.h;
	(cfg_layout_pool): New.
	(record_effective_endpoints, fixup_reorder_chain,
	fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use
	of rbi.
	(cfg_layout_initialize_rbi): New function.
	(cfg_layout_initialize): Use it.
	(cfg_layout_finalize): Clear rbi fields.
	* cfglayout.h (RBI): Kill.
	(cfg_layout_initialize_rbi): Declare.
	* cfgloopmanip.c (copy_bbs): Use rbi.
	(record_exit_edges): Likewise.
	(duplicate_loop_to_header_edge): Likewise.
	* cfgrtl.c (cfg_layout_create_basic_block): Use
	cfg_layout_initialize_rbi.
	(cfg_layout_split_block): Use rbi.
	(cfg_layout_delete_block): Likewise.
	* loop-init.c (loop_optimizer_finalize): Likewise.
	* loop-unswitch.c (unswitch_loop): Likewise.
	* tracer.c (seen, tail_duplicate, layout_superblocks): Likewise.

	* cfgrtl.c: Update comments.
	(try_redirect_by_replacing_jump): New argument.
	(redirect_branch_edge): Break out from ...
	(rtl_redirect_edge_and_branch): ... this one.
	(update_cfg_after_block_merging): Break out from ...
	(rtl_merge_blocks): ... this one.
	(cfg_layout_split_edge): New.
	(cfg_layout_merge_blocks): New.
	(cfg_layout_can_merge_blocks_p): New.
	(cfg_layout_redirect_edge_and_branch): Reorganize.
	(cfg_layout_rtl_cfg_hooks): Fill in.
	(cfg_layout_delete_block): Kill barriers.
	* cfganal.c (can_fallthru): Deal with exit blocks
	* cfglayout.c (cfg_layout_function_header): New function
	(record_effective_endpoints): Record function header.
	(fixup_reorder_chain): Fixup dead jumptables; place header

	* basic-block.h (CLEANUP_CFGLAYOUT): New flag.
	* bb-reorder.c (cfg_layout_initialize): Update call.
	* cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru
	edges in cfglayout mode.
	* cfglayout.c (cleanup_unconditional_jumps): Kill.
	(cfg_layout_initialize): Kill agrument loops; use cfgcleanup.
	* cfglayout.h (cfg_layout_initialize): Update prototype.
	* cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill.
	* cfgloopmanip.c (loop_split_edge_with): Use split_edge.
	* flow.c (propagate_block): Do not crash when basic block ends
	by first insn in the chain.
	* loop-init.c (loop_optimizer_init):  First enter cfglayout mode; later
	do loop discovery.
	* tracer.c (tracer): Update call of cfg_layout_initialize.

From-SVN: r68899
2003-07-03 18:40:29 +00:00
Kaveh R. Ghazi 0108ae51e9 c-semantics.c (genrtl_case_label): Fix format specifier bug.
* c-semantics.c (genrtl_case_label): Fix format specifier bug.
	* cfgrtl.c (rtl_verify_flow_info_1): Likewise.

From-SVN: r68784
2003-07-01 18:28:27 +00:00
Kazu Hirata e0bb17a83f basic-block.h: Fix comment typos.
* basic-block.h: Fix comment typos.
	* bb-reorder.c: Likewise.
	* c-format.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfghooks.h: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* convert.c: Likewise.
	* dbxout.c: Likewise.
	* df.c: Likewise.
	* df.h: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* et-forest.h: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.h: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.
	* genautomata.c: Likewise.
	* ggc-common.c: Likewise.
	* ggc-page.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop-unswitch.c: Likewise.
	* loop.c: Likewise.
	* mips-tfile.c: Likewise.
	* optabs.c: Likewise.
	* ra-build.c: Likewise.
	* ra-colorize.c: Likewise.
	* ra-rewrite.c: Likewise.
	* ra.h: Likewise.
	* regmove.c: Likewise.
	* reload.c: Likewise.
	* rtlanal.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-int.h: Likewise.
	* sched-vis.c: Likewise.
	* sreal.c: Likewise.
	* ssa-ccp.c: Likewise.
	* ssa.c: Likewise.
	* toplev.c: Likewise.
	* tree-inline.c: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.

From-SVN: r68770
2003-07-01 12:18:01 +00:00
Rainer Orth 73383a8105 * cfgrtl.c (mark_killed_regs): Cast HARD_REGNO_NREGS to int.
From-SVN: r68697
2003-06-30 12:00:16 +00:00
Jan Hubicka 3cf5441285 cfgrtl.c (verify_flow_info): Accept degenerated condjumps in cfglayout mode.
* cfgrtl.c (verify_flow_info): Accept degenerated condjumps
	in cfglayout mode.

From-SVN: r68694
2003-06-30 08:04:24 +00:00
Kazu Hirata f9da506452 alloc-pool.c: Fix comment formatting.
* alloc-pool.c: Fix comment formatting.
	* bitmap.c: Likewise.
	* bitmap.h: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* cfganal.c: Likewise.
	* cfgrtl.c: Likewise.
	* collect2.c: Likewise.
	* cse.c: Likewise.
	* df.c: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* expmed.c: Likewise.
	* final.c: Likewise.
	* flags.h: Likewise.
	* fold-const.c: Likewise.
	* gcc.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* libgcov.c: Likewise.
	* mips-tfile.c: Likewise.
	* optabs.c: Likewise.
	* prefix.c: Likewise.
	* rtlanal.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* toplev.c: Likewise.
	* varasm.c: Likewise.
	* vmsdbgout.c: Likewise.

From-SVN: r68672
2003-06-29 13:53:12 +00:00
Zack Weinberg 8ce332308c * c-format.c (check_format_string, get_constant)
* cfgrtl.c (rtl_split_edge):
	Mark the definition static, matching the forward declaration.
cp:
	* decl.c (build_typename_type)
	* mangle.c (write_template_template_arg)
	* parser.c (cp_parser_scope_through_which_access_occurs)
	* pt.c (push_access_scope_real, push_access_scope, pop_access_scope)
	* repo.c (get_base_filename)
	* semantics.c (maybe_convert_cond):
	Mark the definition static, matching the forward declaration.
java:
	* class.c (build_method_symbols_entry)
	* expr.c (get_offset_table_index)
	* jcf-parse.c (jcf_parse):
	Mark the definition static, matching the forward declaration.

From-SVN: r68622
2003-06-28 00:30:31 +00:00
Zdenek Dvorak ff25ef9976 Makefile.in (cfgrtl.o): Add expr.h dependency.
* Makefile.in (cfgrtl.o): Add expr.h dependency.
	* cfgrtl.c: Include expr.h.
	(mark_killed_regs, safe_insert_insn_on_edge): New
	functions.
	* config/i386/i386.h (AVOID_CCMODE_COPIES): Define.
	* basic-block.h (safe_insert_insn_on_edge): Declare.

From-SVN: r68518
2003-06-26 06:13:27 +00:00
Kazu Hirata b20b352b6b ChangeLog.1: Fix a typo.
* ChangeLog.1: Fix a typo.
	* cfgrtl.c: Fix comment typos.
	* dwarf2out.c: Likewise.
	* expmed.c: Likewise.
	* genrecog.c: Likewise.
	* jump.c: Likewise.
	* rtlanal.c: Likewise.
	* ssa-dce.c: Likewise.
	* toplev.c: Likewise.

From-SVN: r68374
2003-06-23 16:11:56 +00:00
Andreas Jaeger d329e058f2 caller-save.c: Convert to ISO C90.
* caller-save.c: Convert to ISO C90.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfghooks.c: Likewise.
	* cfglayout.c: Likewise.
	* cfglayout.h: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmainip.c: Likewise.
	* cfgrtl.c: Likewise.

From-SVN: r68331
2003-06-22 17:03:27 +02:00
Richard Henderson 792bb204af cfgbuild.c (make_edges): Set ABNORMAL with SIBCALL.
* cfgbuild.c (make_edges): Set ABNORMAL with SIBCALL.
        * cfgrtl.c (purge_dead_edges): Expect it too.

From-SVN: r67917
2003-06-13 15:56:09 -07:00
Jan Hubicka f0fda11c8b basic-block.h (flow_delete_block_noexpunge): Kill.
* basic-block.h (flow_delete_block_noexpunge): Kill.
	* cfgrtl.c (flow_delete_block_noexpunge): Merge to
	rtl_delete_block.

From-SVN: r67846
2003-06-12 18:09:56 +00:00
Jan Hubicka 10e9fecc62 i386.md (subsi_3_zext, [...]): Fix predicates.
* i386.md (subsi_3_zext, sse2_nandv2di3): Fix predicates.
	* i386.c (k8_avoid_jump_misspredicts): Fix debug output.

	* cfg.c (verify_flow_info): Move IL independent checks from cfgrtl here.
	(dump_bb): New based on old dump_bb in cfgrtl.c
	(debug_bb, debug_bb_n): Move the functions from cfgrtl.c here.
	* cfghooks.h (cfgh_verify_flow_info): Return status.
	* cfglayout.c (cfg_layout_finalize): Verify CFG correctness.
	* cfgrtl.c (debug_bb, debug_bb_n): Move to cfg.c
	(dump_bb): Remove generic parts.
	(rtl_verify_flow_info_1): Break out from rtl_verify_flow_info.
	(rtl_verify_flow_info): Only check things dependeing on linearized RTL.

	* i386-cmov1.c: Fix regular expression.
	* i386-cvt-1.c: Likewise.
	* i386-local.c: Likewise.
	* i386-local2.c: Likewise.
	* i386-mul.c: Likewise.
	* i386-ssetype-1.c: Likewise.
	* i386-ssetype-3.c: Likewise.
	* i386-ssetype-5.c: Likewise.

From-SVN: r67630
2003-06-08 14:50:18 +00:00
Richard Henderson 1722c2c871 basic-block.h (EDGE_SIBCALL): New.
* basic-block.h (EDGE_SIBCALL): New.
        (EDGE_ALL_FLAGS): Update.
        * cfg.c (dump_edge_info): Add sibcall name.
        * cfgbuild.c (make_edges): Use EDGE_SIBCALL.
        * cfgrtl.c (purge_dead_edges): Handle sibcalls.

From-SVN: r67602
2003-06-07 14:30:49 -07:00
Jan Hubicka 9ee634e345 function.c (FLOOR_ROUND, CEIL_ROUND): Fix.
* function.c (FLOOR_ROUND, CEIL_ROUND): Fix.
	* i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic stack frames.
	(pro_epilogue_adjust_stack_rex64_2): New pattern

	* cfghooks.h, cfghooks.c: New files.
	* Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h.
	(OBJS): Add cfghooks.o.
	(cfghooks.o): New rule.
	* basic-block.h (split_edge): Rename to rtl_split_edge.
	(verify_flow_info): Rename to rtl_verify_flow_info.
	(cfghooks.h): Included here.
	* cfgrtl.c (split_edge): Renamed rtl_split_edge.
	(verify_flow_info): Renamed rtl_verify_flow_info.
	* toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks.

	* basic-block.h (split_block, split_edge, flow_delete_block,
	redirect_edge_and_branch, redirect_edge_and_branch_force): Delete.
	(flow_delete_block_noexpunge):  Return void.
	* cfg.c (verify_flow_info): New function.
	* cfgcleanup.c (try_simplify_condjump, outgoing_edges_match,
	try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks):
	Use delete_block.
	* cfglayout.c (function_footer): Rename to...
	(cfg_layout_function_footer): ... this variable
	(unlink_insn_chain): Make global.
	(fixup_reorder_chain, record_effective_endpoints): Update.
	(cleanup_unconditional_jumps): Use delete_block.
	(cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c
	(cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force.
	(cfg_layout_initialize, cfg_layout_finalize): Update hooks.
	* cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block):  Delete.
	(cfg_layout_function_footer): Declare.
	* cfgloopmanip (split_loop_bb): Do not update RBI.
	(remove_bbs): Use delete_block.
	(loop_reidrect_edge, loop_delete_branch_edge): Use
	redirect_edge_and_branch.
	(create_preheader): Use split_block and redirect_edge_and_branch_force.
	(split_edge_with): Likewise.
	* cfgrtl.c: Include cfglayout.h
	(split_edge): Rename to ...
	(rtl_split_edge) ... this one; make local.
	(redirect_edge_and_branch): Rename to ...
	(rtl_redirect_edge_and_branch) ... this one; make local.
	(redirect_edge_and_branch_force): Rename to ...
	(rtl_redirect_edge_and_branch_force) ... this one; make local.
	(cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New.
	(cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from
	cfglayout.c; update to directly call RTL counterparts.
	(rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions.
	* ifcvt.c (find_cond_trap): Use delete_block.
	(find_if_case_1): Use delete_block.
	(find_if_case_2): Use delete_block.
	* rtl.h (unlink_insn_chain): Declare.
	* toplev.c (rtl_reigster_cfg_hooks): New.

From-SVN: r67535
2003-06-06 09:24:26 +00:00
Richard Henderson 4da2eb6b90 re PR middle-end/8866 (Bug in switch statement code generation -- missing label)
PR 8866
        * rtl.h (MEM_NOTRAP_P): New.
        (MEM_COPY_ATTRIBUTES): Copy it.
        * rtlanal.c (may_trap_p): Check it.
        * expr.c (do_tablejump): Set it.
        * doc/rtl.texi (Flags): Document it.

        * cfgrtl.c (try_redirect_by_replacing_jump): Revert last three changes.

From-SVN: r65967
2003-04-22 16:17:46 -07:00
Mark Mitchell eb5b8ad452 cfgrtl.c (try_redirect_by_replacing_jump): Create a basic block for orphaned jump tables.
* cfgrtl.c (try_redirect_by_replacing_jump): Create a basic block
	for orphaned jump tables.

From-SVN: r65792
2003-04-18 22:04:12 +00:00
Mark Mitchell f2d80e7e81 re PR middle-end/8866 (Bug in switch statement code generation -- missing label)
PR middle-end/8866
	* cfgtrl.c (try_redirect_by_replacing_jump): Do not delete
	jumptables.

	PR middle-end/8866
	* libjava.lang/PR8866.java: New test.

From-SVN: r65698
2003-04-16 20:39:12 +00:00
Jan Hubicka 58e6ae30c7 re PR rtl-optimization/10024 ([HP-PA] inline optimization ICE)
PR opt/10024
	* cfgrtl.c (force_nonfallthru_and_redirect): Use unchecked_make_edge.

From-SVN: r65571
2003-04-14 14:19:12 +00:00
Jan Hubicka cde1d5bf91 re PR rtl-optimization/10024 ([HP-PA] inline optimization ICE)
PR opt/10024
	* cfglayout.c (cfg_layout_redirect_edge):
	Redirect any branch edges unified with the fallthru one.
	* cfgrtl.c (force_nonfallthru_and_redirect):  Do not special
	case fallthru edges when called via cfglayout.c

From-SVN: r65330
2003-04-07 12:36:59 +00:00
Jan Hubicka bcc53e2a94 * cfgrtl.c (update_bb_for_insn): Do not set block for barriers.
From-SVN: r65214
2003-04-03 20:28:39 +00:00
Richard Henderson e1233a7dc0 cfgbuild.c (make_edges): Use tablejump_p.
* cfgbuild.c (make_edges): Use tablejump_p.
        * cfgcleanup.c (label_is_jump_target_p): Likewise.
        * cfglayout.c (cfg_layout_can_duplicate_bb_p): Likewise.
        * cfgrtl.c (flow_delete_block_noexpunge): Likewise.
        (try_redirect_by_replacing_jump): Likewise.
        (redirect_edge_and_branch): Likewise.
        * cse.c (fold_rtx): Likewise.
        * jump.c (delete_related_insns): Likewise.
        * rtlanal.c (get_jump_table_offset): Likewise.
        * ssa-ccp.c (ssa_ccp_df_delete_unreachable_insns): Likewise.

From-SVN: r65054
2003-03-30 12:46:57 -08:00
Jan Hubicka cb9a1d9bb6 re PR rtl-optimization/10056 ([HP-PA] ICE at -O2 when building c++ code from doxygen)
PR opt/10056
	* cfglayout.c (fixup_reorder_chain):  Fix dealing with the conditional
	jump jumping to the next instruction.
	* cfgrtl.c (force_nonfallthru_and_redirect):  Likewise.

From-SVN: r64854
2003-03-25 19:20:34 +00:00
Richard Henderson ef3e988690 cfgcleanup.c (try_optimize_cfg): Allow merging of tablejumps before flow2.
* cfgcleanup.c (try_optimize_cfg): Allow merging of tablejumps
        before flow2.
        * cfgrtl.c (try_redirect_by_replacing_jump): Similarly.

From-SVN: r64754
2003-03-23 12:40:26 -08:00
Zdenek Dvorak 35b0708052 basic-block.h (EDGE_IRREDUCIBLE_LOOP, [...]): New.
* basic-block.h (EDGE_IRREDUCIBLE_LOOP, EDGE_ALL_FLAGS): New.
	* cfg.c (dump_edge_info): Add EDGE_IRREDUCIBLE_LOOP flag dump.
	* cfgloop.c (flow_loop_free): Made global.
	(establish_preds): New static function.
	(flow_loop_tree_node_add): Handle subloops of added loop correctly.
	(get_loop_exit_edges): New.
	(verify_loop_structure): Verify EDGE_IRREDUCIBLE_LOOP flags.
	* cfgloop.h (flow_loop_free, get_loop_exit_edges, unloop): Declare.
	* cfgloopanal.c (mark_irreducible_loops): Mark edges in irreducible
	loops.
	* cfgloopmanip.c (loop_delete_branch_edge): Allow to test for
	removability of an edge.
	(fix_irreducible_loops): New static function.
	(find_path, remove_path): Add ability to remove enclosing loops.
	(unloop): New.
	(copy_bbs, duplicate_loop_to_header_edge): Use EDGE_IRREDUCIBLE_LOOP
	flags.
	* cfgrtl.c (verify_flow_info): Handle EDGE_IRREDUCIBLE_LOOP flag.
	* loop-unroll.c (peel_loops_completely): Do not duplicate loop if
	not neccessary.
	(decide_peel_completely, peel_loops_completely): Allow complete peeling
	of non-duplicable once rolling loops.
	* loop-unswitch.c (unswitch_loop): Update EDGE_IRREDUCIBLE_LOOP flags.

From-SVN: r63864
2003-03-05 22:05:18 +00:00
Jan Hubicka 9809a3624d cfgrtl.c (commit_edge_insertions): Call find_many_sub_basic_block only when some code has been emitted.
* cfgrtl.c (commit_edge_insertions):  Call
	find_many_sub_basic_block only when some code has been emitted.
	(commit_edge_insertions_watch_calls): Bring into sync with
	commit_edge_insertions

From-SVN: r63248
2003-02-21 22:14:23 +00:00
Jan Hubicka 9dca2ad510 cfgrtl.c (commit_one_edge_insertion): Only mark BB for splitting.
* cfgrtl.c (commit_one_edge_insertion): Only mark BB for splitting.
	(commit_edge_insertions): Call find_many_sub_basic_blocks

	* reg-stack.c (convert_regs): Cleax aux for blocks.

From-SVN: r63216
2003-02-21 10:06:44 +00:00
Jan Hubicka 83fd323c4c cfgrtl.c (verify_flow_info): Use control_flow_insn_p.
* cfgrtl.c (verify_flow_info):  Use control_flow_insn_p.
	* reload1.c (fixup_abnormal_edges):  Split basic blocks when EH edges
	possibly got duplicated.

From-SVN: r62599
2003-02-09 11:06:41 +00:00
Kazu Hirata 95bd1dd72f alias.c: Fix comment typos.
* alias.c: Fix comment typos.
	* basic-block.h: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* c-pragma.c: Likewise.
	* c-pretty-print.h: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgrtl.c: Likewise.
	* convert.c: Likewise.
	* cpphash.h: Likewise.
	* cpplex.c: Likewise.
	* cpplib.h: Likewise.
	* df.h: Likewise.
	* diagnostic.c: Likewise.
	* diagnostic.h: Likewise.
	* dwarf2.h: Likewise.

From-SVN: r61462
2003-01-18 02:26:43 +00:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Kazu Hirata 09da15320b c-decl.c: Fix a comment typo.
* c-decl.c: Fix a comment typo.
	* cfg.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgrtl.c: Likewise.
	* c-typeck.c: Likewise.
	* dominance.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarfout.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* flow.c: Likewise.
	* function.c: Likewise.
	* gcc.c: Likewise.
	* genautomata.c: Likewise.
	* integrate.c: Likewise.
	* loop.c: Likewise.
	* loop.h: Likewise.
	* output.h: Likewise.
	* profile.c: Likewise.
	* ra.h: Likewise.
	* reload1.c: Likewise.
	* reload.c: Likewise.
	* sched-rgn.c: Likewise.
	* stmt.c: Likewise.
	* tree.h: Likewise.
	* vmsdbgout.c: Likewise.

From-SVN: r60085
2002-12-13 00:17:22 +00:00