Commit f7aa1423 by Steven Bosscher Committed by Steven Bosscher

re PR middle-end/16585 (current_function_has_computed_jump incorrectly changed in make_edges)

	PR middle-end/16585
	* cfgbuild.c (make_edges): Do not clear or set
	current_function_has_computed_jump.
	* function.h (struct function): Remove the has_computed_jump field.
	(current_function_has_computed_jump): Do not define.
	* sched-rgn.c (is_cfg_nonregular): Return true if a basic block ends
	in a computed jump.  Ignore current_function_has_computed_jump.

From-SVN: r94269
parent b929615a
2005-01-26 Steven Bosscher <stevenb@suse.de>
PR middle-end/16585
* cfgbuild.c (make_edges): Do not clear or set
current_function_has_computed_jump.
* function.h (struct function): Remove the has_computed_jump field.
(current_function_has_computed_jump): Do not define.
* sched-rgn.c (is_cfg_nonregular): Return true if a basic block ends
in a computed jump. Ignore current_function_has_computed_jump.
2005-01-26 Richard Henderson <rth@redhat.com> 2005-01-26 Richard Henderson <rth@redhat.com>
PR middle-end/19515 PR middle-end/19515
......
...@@ -227,18 +227,6 @@ make_edges (basic_block min, basic_block max, int update_p) ...@@ -227,18 +227,6 @@ make_edges (basic_block min, basic_block max, int update_p)
basic_block bb; basic_block bb;
sbitmap *edge_cache = NULL; sbitmap *edge_cache = NULL;
/* Assume no computed jump; revise as we create edges. */
current_function_has_computed_jump = 0;
/* If we are partitioning hot and cold basic blocks into separate
sections, we cannot assume there is no computed jump (partitioning
sometimes requires the use of indirect jumps; see comments about
partitioning at the top of bb-reorder.c:partition_hot_cold_basic_blocks
for complete details). */
if (flag_reorder_blocks_and_partition)
current_function_has_computed_jump = 1;
/* Heavy use of computed goto in machine-generated code can lead to /* Heavy use of computed goto in machine-generated code can lead to
nearly fully-connected CFGs. In that case we spend a significant nearly fully-connected CFGs. In that case we spend a significant
amount of time searching the edge lists for duplicates. */ amount of time searching the edge lists for duplicates. */
...@@ -325,8 +313,6 @@ make_edges (basic_block min, basic_block max, int update_p) ...@@ -325,8 +313,6 @@ make_edges (basic_block min, basic_block max, int update_p)
everything on the forced_labels list. */ everything on the forced_labels list. */
else if (computed_jump_p (insn)) else if (computed_jump_p (insn))
{ {
current_function_has_computed_jump = 1;
for (x = forced_labels; x; x = XEXP (x, 1)) for (x = forced_labels; x; x = XEXP (x, 1))
make_label_edge (edge_cache, bb, XEXP (x, 0), EDGE_ABNORMAL); make_label_edge (edge_cache, bb, XEXP (x, 0), EDGE_ABNORMAL);
} }
......
...@@ -375,9 +375,6 @@ struct function GTY(()) ...@@ -375,9 +375,6 @@ struct function GTY(())
/* Nonzero if function being compiled contains nested functions. */ /* Nonzero if function being compiled contains nested functions. */
unsigned int contains_functions : 1; unsigned int contains_functions : 1;
/* Nonzero if the function being compiled issues a computed jump. */
unsigned int has_computed_jump : 1;
/* Nonzero if the current function is a thunk, i.e., a lightweight /* Nonzero if the current function is a thunk, i.e., a lightweight
function implemented by the output_mi_thunk hook) that just function implemented by the output_mi_thunk hook) that just
adjusts one of its arguments and forwards to another adjusts one of its arguments and forwards to another
...@@ -447,7 +444,6 @@ extern int trampolines_created; ...@@ -447,7 +444,6 @@ extern int trampolines_created;
#define current_function_calls_setjmp (cfun->calls_setjmp) #define current_function_calls_setjmp (cfun->calls_setjmp)
#define current_function_calls_alloca (cfun->calls_alloca) #define current_function_calls_alloca (cfun->calls_alloca)
#define current_function_calls_eh_return (cfun->calls_eh_return) #define current_function_calls_eh_return (cfun->calls_eh_return)
#define current_function_has_computed_jump (cfun->has_computed_jump)
#define current_function_contains_functions (cfun->contains_functions) #define current_function_contains_functions (cfun->contains_functions)
#define current_function_is_thunk (cfun->is_thunk) #define current_function_is_thunk (cfun->is_thunk)
#define current_function_args_info (cfun->args_info) #define current_function_args_info (cfun->args_info)
......
...@@ -291,7 +291,6 @@ is_cfg_nonregular (void) ...@@ -291,7 +291,6 @@ is_cfg_nonregular (void)
{ {
basic_block b; basic_block b;
rtx insn; rtx insn;
RTX_CODE code;
/* If we have a label that could be the target of a nonlocal goto, then /* If we have a label that could be the target of a nonlocal goto, then
the cfg is not well structured. */ the cfg is not well structured. */
...@@ -302,11 +301,6 @@ is_cfg_nonregular (void) ...@@ -302,11 +301,6 @@ is_cfg_nonregular (void)
if (forced_labels) if (forced_labels)
return 1; return 1;
/* If this function has a computed jump, then we consider the cfg
not well structured. */
if (current_function_has_computed_jump)
return 1;
/* If we have exception handlers, then we consider the cfg not well /* If we have exception handlers, then we consider the cfg not well
structured. ?!? We should be able to handle this now that flow.c structured. ?!? We should be able to handle this now that flow.c
computes an accurate cfg for EH. */ computes an accurate cfg for EH. */
...@@ -315,24 +309,23 @@ is_cfg_nonregular (void) ...@@ -315,24 +309,23 @@ is_cfg_nonregular (void)
/* If we have non-jumping insns which refer to labels, then we consider /* If we have non-jumping insns which refer to labels, then we consider
the cfg not well structured. */ the cfg not well structured. */
/* Check for labels referred to other thn by jumps. */
FOR_EACH_BB (b) FOR_EACH_BB (b)
for (insn = BB_HEAD (b); ; insn = NEXT_INSN (insn)) FOR_BB_INSNS (b, insn)
{ {
code = GET_CODE (insn); /* Check for labels referred by non-jump insns. */
if (INSN_P (insn) && code != JUMP_INSN) if (NONJUMP_INSN_P (insn) || CALL_P (insn))
{ {
rtx note = find_reg_note (insn, REG_LABEL, NULL_RTX); rtx note = find_reg_note (insn, REG_LABEL, NULL_RTX);
if (note if (note
&& ! (JUMP_P (NEXT_INSN (insn)) && ! (JUMP_P (NEXT_INSN (insn))
&& find_reg_note (NEXT_INSN (insn), REG_LABEL, && find_reg_note (NEXT_INSN (insn), REG_LABEL,
XEXP (note, 0)))) XEXP (note, 0))))
return 1; return 1;
} }
/* If this function has a computed jump, then we consider the cfg
if (insn == BB_END (b)) not well structured. */
break; else if (JUMP_P (insn) && computed_jump_p (insn))
return 1;
} }
/* Unreachable loops with more than one basic block are detected /* Unreachable loops with more than one basic block are detected
......
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