aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2003-10-17 10:30:43 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2003-10-17 10:30:43 +0000
commit38b2a60531f0da9ee440c82248774bf53596edf0 (patch)
tree928bee86d93980327cae8586d6a0f0b03207bc6e /gcc/flow.c
parentb8fa9ea13306d2289541c6c1765d787b96d0451b (diff)
downloadgcc-38b2a60531f0da9ee440c82248774bf53596edf0.zip
gcc-38b2a60531f0da9ee440c82248774bf53596edf0.tar.gz
gcc-38b2a60531f0da9ee440c82248774bf53596edf0.tar.bz2
flow.c (init_propagate_block_info): Don't abort if a conditional jump is not a comparison of a register.
* flow.c (init_propagate_block_info): Don't abort if a conditional jump is not a comparison of a register. Instead, just don't record conditional life information. From-SVN: r72594
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c79
1 files changed, 42 insertions, 37 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 66c04ee..2694a0b 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -1861,16 +1861,15 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
free_reg_cond_life_info);
pbi->reg_cond_reg = BITMAP_XMALLOC ();
- /* If this block ends in a conditional branch, for each register live
- from one side of the branch and not the other, record the register
- as conditionally dead. */
+ /* If this block ends in a conditional branch, for each register
+ live from one side of the branch and not the other, record the
+ register as conditionally dead. */
if (GET_CODE (bb->end) == JUMP_INSN
&& any_condjump_p (bb->end))
{
regset_head diff_head;
regset diff = INITIALIZE_REG_SET (diff_head);
basic_block bb_true, bb_false;
- rtx cond_true, cond_false, set_src;
int i;
/* Identify the successor blocks. */
@@ -1898,53 +1897,59 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
bb_false = bb_true;
}
- /* Extract the condition from the branch. */
- set_src = SET_SRC (pc_set (bb->end));
- cond_true = XEXP (set_src, 0);
- cond_false = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond_true)),
- GET_MODE (cond_true), XEXP (cond_true, 0),
- XEXP (cond_true, 1));
- if (GET_CODE (XEXP (set_src, 1)) == PC)
- {
- rtx t = cond_false;
- cond_false = cond_true;
- cond_true = t;
- }
-
/* Compute which register lead different lives in the successors. */
if (bitmap_operation (diff, bb_true->global_live_at_start,
bb_false->global_live_at_start, BITMAP_XOR))
{
+ /* Extract the condition from the branch. */
+ rtx set_src = SET_SRC (pc_set (bb->end));
+ rtx cond_true = XEXP (set_src, 0);
rtx reg = XEXP (cond_true, 0);
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
- if (GET_CODE (reg) != REG)
- abort ();
+ /* We can only track conditional lifetimes if the condition is
+ in the form of a comparison of a register against zero.
+ If the condition is more complex than that, then it is safe
+ not to record any information. */
+ if (GET_CODE (reg) == REG
+ && XEXP (cond_true, 1) == const0_rtx)
+ {
+ rtx cond_false
+ = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond_true)),
+ GET_MODE (cond_true), XEXP (cond_true, 0),
+ XEXP (cond_true, 1));
+ if (GET_CODE (XEXP (set_src, 1)) == PC)
+ {
+ rtx t = cond_false;
+ cond_false = cond_true;
+ cond_true = t;
+ }
- SET_REGNO_REG_SET (pbi->reg_cond_reg, REGNO (reg));
+ SET_REGNO_REG_SET (pbi->reg_cond_reg, REGNO (reg));
- /* For each such register, mark it conditionally dead. */
- EXECUTE_IF_SET_IN_REG_SET
- (diff, 0, i,
- {
- struct reg_cond_life_info *rcli;
- rtx cond;
+ /* For each such register, mark it conditionally dead. */
+ EXECUTE_IF_SET_IN_REG_SET
+ (diff, 0, i,
+ {
+ struct reg_cond_life_info *rcli;
+ rtx cond;
- rcli = xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
- if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
- cond = cond_false;
- else
- cond = cond_true;
- rcli->condition = cond;
- rcli->stores = const0_rtx;
- rcli->orig_condition = cond;
+ if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
+ cond = cond_false;
+ else
+ cond = cond_true;
+ rcli->condition = cond;
+ rcli->stores = const0_rtx;
+ rcli->orig_condition = cond;
- splay_tree_insert (pbi->reg_cond_dead, i,
- (splay_tree_value) rcli);
- });
+ splay_tree_insert (pbi->reg_cond_dead, i,
+ (splay_tree_value) rcli);
+ });
+ }
}
FREE_REG_SET (diff);