diff options
author | Michael Matz <matz@gcc.gnu.org> | 2011-04-08 20:18:08 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2011-04-08 20:18:08 +0000 |
commit | 42821aff0aa8c8118a0e19c2dc640b24ad26e1dc (patch) | |
tree | 913be8fcb10baa2e6e9e098eeb7d7b28a3bc79b9 /gcc/jump.c | |
parent | ad7be0090c0276c2526887944f5f6927e20507f2 (diff) | |
download | gcc-42821aff0aa8c8118a0e19c2dc640b24ad26e1dc.zip gcc-42821aff0aa8c8118a0e19c2dc640b24ad26e1dc.tar.gz gcc-42821aff0aa8c8118a0e19c2dc640b24ad26e1dc.tar.bz2 |
re PR rtl-optimization/48389 (ICE: in make_edges, at cfgbuild.c:319 with -mtune=pentiumpro)
PR middle-end/48389
* jump.c (rebuild_jump_labels_1, rebuild_jump_labels_chain): New
functions.
(rebuild_jump_labels): Call rebuild_jump_labels_1.
* rtl.h (rebuild_jump_labels_chain): Declare.
* cfgexpand.c (gimple_expand_cfg): Initialize JUMP_LABEL also on
insns inserted on edges.
testsuite/
* gcc.target/i386/pr48389.c: New test.
From-SVN: r172208
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 35 |
1 files changed, 26 insertions, 9 deletions
@@ -72,12 +72,9 @@ static void redirect_exp_1 (rtx *, rtx, rtx, rtx); static int invert_exp_1 (rtx, rtx); static int returnjump_p_1 (rtx *, void *); -/* This function rebuilds the JUMP_LABEL field and REG_LABEL_TARGET - notes in jumping insns and REG_LABEL_OPERAND notes in non-jumping - instructions and jumping insns that have labels as operands - (e.g. cbranchsi4). */ -void -rebuild_jump_labels (rtx f) +/* Worker for rebuild_jump_labels and rebuild_jump_labels_chain. */ +static void +rebuild_jump_labels_1 (rtx f, bool count_forced) { rtx insn; @@ -89,11 +86,31 @@ rebuild_jump_labels (rtx f) closely enough to delete them here, so make sure their reference count doesn't drop to zero. */ - for (insn = forced_labels; insn; insn = XEXP (insn, 1)) - if (LABEL_P (XEXP (insn, 0))) - LABEL_NUSES (XEXP (insn, 0))++; + if (count_forced) + for (insn = forced_labels; insn; insn = XEXP (insn, 1)) + if (LABEL_P (XEXP (insn, 0))) + LABEL_NUSES (XEXP (insn, 0))++; timevar_pop (TV_REBUILD_JUMP); } + +/* This function rebuilds the JUMP_LABEL field and REG_LABEL_TARGET + notes in jumping insns and REG_LABEL_OPERAND notes in non-jumping + instructions and jumping insns that have labels as operands + (e.g. cbranchsi4). */ +void +rebuild_jump_labels (rtx f) +{ + rebuild_jump_labels_1 (f, true); +} + +/* This function is like rebuild_jump_labels, but doesn't run over + forced_labels. It can be used on insn chains that aren't the + main function chain. */ +void +rebuild_jump_labels_chain (rtx chain) +{ + rebuild_jump_labels_1 (chain, false); +} /* Some old code expects exactly one BARRIER as the NEXT_INSN of a non-fallthru insn. This is not generally true, as multiple barriers |