summaryrefslogtreecommitdiff
path: root/gcc/sched-rgn.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-26 17:26:33 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-26 17:26:33 +0000
commitcd6dccd365b9354fc13cdb1604ff2a71e610072b (patch)
tree01482693087a7300ccd5d02237745f640bf1246e /gcc/sched-rgn.c
parent7e6d57367fa14312ce44831e4e24d7b9a3d712f3 (diff)
downloadgcc-cd6dccd365b9354fc13cdb1604ff2a71e610072b.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94269 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-rgn.c')
-rw-r--r--gcc/sched-rgn.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index f4f73f86f2f..d5004e4e032 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -291,7 +291,6 @@ is_cfg_nonregular (void)
{
basic_block b;
rtx insn;
- RTX_CODE code;
/* If we have a label that could be the target of a nonlocal goto, then
the cfg is not well structured. */
@@ -302,11 +301,6 @@ is_cfg_nonregular (void)
if (forced_labels)
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
structured. ?!? We should be able to handle this now that flow.c
computes an accurate cfg for EH. */
@@ -315,24 +309,23 @@ is_cfg_nonregular (void)
/* If we have non-jumping insns which refer to labels, then we consider
the cfg not well structured. */
- /* Check for labels referred to other thn by jumps. */
FOR_EACH_BB (b)
- for (insn = BB_HEAD (b); ; insn = NEXT_INSN (insn))
+ FOR_BB_INSNS (b, insn)
{
- code = GET_CODE (insn);
- if (INSN_P (insn) && code != JUMP_INSN)
+ /* Check for labels referred by non-jump insns. */
+ if (NONJUMP_INSN_P (insn) || CALL_P (insn))
{
rtx note = find_reg_note (insn, REG_LABEL, NULL_RTX);
-
if (note
&& ! (JUMP_P (NEXT_INSN (insn))
&& find_reg_note (NEXT_INSN (insn), REG_LABEL,
XEXP (note, 0))))
return 1;
}
-
- if (insn == BB_END (b))
- break;
+ /* If this function has a computed jump, then we consider the cfg
+ not well structured. */
+ else if (JUMP_P (insn) && computed_jump_p (insn))
+ return 1;
}
/* Unreachable loops with more than one basic block are detected