Commit 46fac664 by Jan Hubicka Committed by Jan Hubicka

flow.c (merge_blocks_move_successor_nojumps): Do not crash when fallthru edge is present.

	* flow.c (merge_blocks_move_successor_nojumps): Do not crash
	when fallthru edge is present.
	(mege_blocks): Handle case where creation of jump insn
	is required.

	* basic-block.h (CLEANUP_EXPENSIVE, CLEANUP_CROSSJUMP,
	CLEANUP_POST_REGSTACK): New constants.
	* except.c (finish_eh_generation): Update call of cleanup_cfg,
	* jump.c (rtx_renumbered_equal_p): Handle 't' fields.
	* output.h (cleanup_cfg): Update prototype.
	* reg-stack.c (reg_to_stack): Use cleanup_cfg instead of jump_optimize
	* sibcall.c (optimize_sibling_and_tail_recursive_call): Update
	cleanup_cfg call; kill missleading comment.
	* toplev.c (rest_of_compilation): Update all cleanup_cfg calls.
	* flow.c (merge_blocks, try_optimize_cfg, cleanup_cfg): Accept mode
	parameter; control optimizations performed using it.
	(flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
	try_crossjump_bb): New functions.

From-SVN: r43950
parent 669f7a03
Wed Jul 11 21:27:25 CEST 2001 Jan Hubicka <jh@suse.cz>
* flow.c (merge_blocks_move_successor_nojumps): Do not crash
when fallthru edge is present.
(mege_blocks): Handle case where creation of jump insn
is required.
* basic-block.h (CLEANUP_EXPENSIVE, CLEANUP_CROSSJUMP,
CLEANUP_POST_REGSTACK): New constants.
* except.c (finish_eh_generation): Update call of cleanup_cfg,
* jump.c (rtx_renumbered_equal_p): Handle 't' fields.
* output.h (cleanup_cfg): Update prototype.
* reg-stack.c (reg_to_stack): Use cleanup_cfg instead of jump_optimize
* sibcall.c (optimize_sibling_and_tail_recursive_call): Update
cleanup_cfg call; kill missleading comment.
* toplev.c (rest_of_compilation): Update all cleanup_cfg calls.
* flow.c (merge_blocks, try_optimize_cfg, cleanup_cfg): Accept mode
parameter; control optimizations performed using it.
(flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
try_crossjump_bb): New functions.
2001-07-11 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa.c (pa_output_function_prologue): Delete prototype. Make function
......
......@@ -535,6 +535,11 @@ enum update_life_extent
#define PROP_AUTOINC 32 /* Create autoinc mem references. */
#define PROP_FINAL 63 /* All of the above. */
#define CLEANUP_EXPENSIVE 1 /* Do relativly expensive optimizations
except for edge forwarding */
#define CLEANUP_CROSSJUMP 2 /* Do crossjumping. */
#define CLEANUP_POST_REGSTACK 4 /* We run after reg-stack and need
to care REG_DEAD notes. */
/* Flags for loop discovery. */
#define LOOP_TREE 1 /* Build loop hierarchy tree. */
......
......@@ -2349,7 +2349,7 @@ finish_eh_generation ()
jump_optimize_minimal (get_insns ());
find_basic_blocks (get_insns (), max_reg_num (), 0);
cleanup_cfg ();
cleanup_cfg (0);
/* These registers are used by the landing pads. Make sure they
have been generated. */
......@@ -2372,7 +2372,7 @@ finish_eh_generation ()
find_exception_handler_labels ();
jump_optimize_minimal (get_insns ());
find_basic_blocks (get_insns (), max_reg_num (), 0);
cleanup_cfg ();
cleanup_cfg (0);
}
/* This section handles removing dead code for flow. */
......
......@@ -3669,6 +3669,11 @@ rtx_renumbered_equal_p (x, y)
return 0;
break;
case 't':
if (XTREE (x, i) != XTREE (y, i))
return 0;
break;
case 's':
if (strcmp (XSTR (x, i), XSTR (y, i)))
return 0;
......
......@@ -137,7 +137,7 @@ extern void allocate_for_life_analysis PARAMS ((void));
extern int regno_uninitialized PARAMS ((int));
extern int regno_clobbered_at_setjmp PARAMS ((int));
extern void find_basic_blocks PARAMS ((rtx, int, FILE *));
extern void cleanup_cfg PARAMS ((void));
extern void cleanup_cfg PARAMS ((int));
extern void check_function_return_warnings PARAMS ((void));
#endif
......
......@@ -476,10 +476,7 @@ reg_to_stack (first, file)
"stack_regs_mentioned cache");
if (convert_regs (file) && optimize)
{
jump_optimize (first, JUMP_CROSS_JUMP_DEATH_MATTERS,
!JUMP_NOOP_MOVES, !JUMP_AFTER_REGSCAN);
}
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP | CLEANUP_POST_REGSTACK);
/* Clean up. */
VARRAY_FREE (stack_regs_mentioned_data);
......
......@@ -565,15 +565,11 @@ optimize_sibling_and_tail_recursive_calls ()
ahead and find all the EH labels. */
find_exception_handler_labels ();
/* Run a jump optimization pass to clean up the CFG. We primarily want
this to thread jumps so that it is obvious which blocks jump to the
epilouge. */
jump_optimize_minimal (insns);
/* We need cfg information to determine which blocks are succeeded
only by the epilogue. */
find_basic_blocks (insns, max_reg_num (), 0);
cleanup_cfg ();
cleanup_cfg (0);
/* If there are no basic blocks, then there is nothing to do. */
if (n_basic_blocks == 0)
......
......@@ -2963,7 +2963,7 @@ rest_of_compilation (decl)
open_dump_file (DFI_ssa, decl);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
cleanup_cfg ();
cleanup_cfg (CLEANUP_EXPENSIVE);
convert_to_ssa ();
close_dump_file (DFI_ssa, print_rtl_with_bb, insns);
......@@ -3028,7 +3028,7 @@ rest_of_compilation (decl)
if (optimize > 0)
{
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
cleanup_cfg ();
cleanup_cfg (CLEANUP_EXPENSIVE);
/* ??? Run if-conversion before delete_null_pointer_checks,
since the later does not preserve the CFG. This should
......@@ -3098,7 +3098,7 @@ rest_of_compilation (decl)
timevar_push (TV_JUMP);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
cleanup_cfg ();
cleanup_cfg (CLEANUP_EXPENSIVE);
delete_null_pointer_checks (insns);
timevar_pop (TV_JUMP);
......@@ -3132,7 +3132,7 @@ rest_of_compilation (decl)
open_dump_file (DFI_gcse, decl);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
cleanup_cfg ();
cleanup_cfg (CLEANUP_EXPENSIVE);
tem = gcse_main (insns, rtl_dump_file);
save_csb = flag_cse_skip_blocks;
......@@ -3236,7 +3236,7 @@ rest_of_compilation (decl)
timevar_push (TV_IFCVT);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
cleanup_cfg ();
cleanup_cfg (CLEANUP_EXPENSIVE);
if_convert (0);
timevar_pop(TV_IFCVT);
......@@ -3282,7 +3282,7 @@ rest_of_compilation (decl)
open_dump_file (DFI_cfg, decl);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
cleanup_cfg ();
cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
check_function_return_warnings ();
/* It may make more sense to mark constant functions after dead code is
......@@ -3365,7 +3365,7 @@ rest_of_compilation (decl)
timevar_push (TV_FLOW);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
cleanup_cfg ();
cleanup_cfg (CLEANUP_EXPENSIVE);
/* Blimey. We've got to have the CFG up to date for the call to
if_convert below. However, the random deletion of blocks
......@@ -3576,7 +3576,7 @@ rest_of_compilation (decl)
if (optimize)
{
cleanup_cfg ();
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP);
life_analysis (insns, rtl_dump_file, PROP_FINAL);
/* This is kind of a heuristic. We need to run combine_stack_adjustments
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment