summaryrefslogtreecommitdiff
path: root/gcc/sched-rgn.c
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-24 22:15:54 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-24 22:15:54 +0000
commita8d1dae016ad1cbc9604e7b150190f69d46d0ca0 (patch)
tree7dc842093d9a325576f2a5371a5f79eaf8125394 /gcc/sched-rgn.c
parent06ffe8d28c052b5b6a3f6683897c2b2d509f7b72 (diff)
downloadgcc-a8d1dae016ad1cbc9604e7b150190f69d46d0ca0.tar.gz
* rtlanal.c (label_is_jump_target_p): Return true for a matching
REG_LABEL_TARGET. * reorg.c (fill_slots_from_thread): Correct last change to use NULL_RTX, not NULL. Outside of REG_NOTES loop, increase and decrease LABEL_NUSES for JUMP_LABEL (trial), not XEXP (note, 0). * jump.c (mark_jump_label_1): Add comment for last change regarding JUMP_LABEL setting. * gcse.c (add_label_notes): Remove conditional that the label is mentioned in insn before adding regnote. * sched-rgn.c (is_cfg_nonregular): Don't return 1 for a single_set insn only feeding a label to a jump through a register that dies there. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130398 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-rgn.c')
-rw-r--r--gcc/sched-rgn.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 12f2e66832b..b340bd532e4 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -320,16 +320,40 @@ is_cfg_nonregular (void)
FOR_EACH_BB (b)
FOR_BB_INSNS (b, insn)
{
- /* Check for labels referred to but (at least not directly) as
- jump targets. */
- if (INSN_P (insn)
- && find_reg_note (insn, REG_LABEL_OPERAND, NULL_RTX))
- return 1;
+ rtx note, next, set, dest;
/* If this function has a computed jump, then we consider the cfg
not well structured. */
if (JUMP_P (insn) && computed_jump_p (insn))
return 1;
+
+ if (!INSN_P (insn))
+ continue;
+
+ note = find_reg_note (insn, REG_LABEL_OPERAND, NULL_RTX);
+ if (note == NULL_RTX)
+ continue;
+
+ /* For that label not to be seen as a referred-to label, this
+ must be a single-set which is feeding a jump *only*. This
+ could be a conditional jump with the label split off for
+ machine-specific reasons or a casesi/tablejump. */
+ next = next_nonnote_insn (insn);
+ if (next == NULL_RTX
+ || !JUMP_P (next)
+ || (JUMP_LABEL (next) != XEXP (note, 0)
+ && find_reg_note (next, REG_LABEL_TARGET,
+ XEXP (note, 0)) == NULL_RTX)
+ || BLOCK_FOR_INSN (insn) != BLOCK_FOR_INSN (next))
+ return 1;
+
+ set = single_set (insn);
+ if (set == NULL_RTX)
+ return 1;
+
+ dest = SET_DEST (set);
+ if (!REG_P (dest) || !dead_or_set_p (next, dest))
+ return 1;
}
/* Unreachable loops with more than one basic block are detected