Commit 38b2a605 by Richard Earnshaw Committed by Richard Earnshaw

flow.c (init_propagate_block_info): Don't abort if a conditional jump is not a…

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
parent b8fa9ea1
2003-10-17 Richard Earnshaw <rearnsha@arm.com>
* 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.
2003-10-16 Jan Hubicka <jh@suse.cz> 2003-10-16 Jan Hubicka <jh@suse.cz>
PR optimization/12630 PR optimization/12630
......
...@@ -1861,16 +1861,15 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, ...@@ -1861,16 +1861,15 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
free_reg_cond_life_info); free_reg_cond_life_info);
pbi->reg_cond_reg = BITMAP_XMALLOC (); pbi->reg_cond_reg = BITMAP_XMALLOC ();
/* If this block ends in a conditional branch, for each register live /* If this block ends in a conditional branch, for each register
from one side of the branch and not the other, record the register live from one side of the branch and not the other, record the
as conditionally dead. */ register as conditionally dead. */
if (GET_CODE (bb->end) == JUMP_INSN if (GET_CODE (bb->end) == JUMP_INSN
&& any_condjump_p (bb->end)) && any_condjump_p (bb->end))
{ {
regset_head diff_head; regset_head diff_head;
regset diff = INITIALIZE_REG_SET (diff_head); regset diff = INITIALIZE_REG_SET (diff_head);
basic_block bb_true, bb_false; basic_block bb_true, bb_false;
rtx cond_true, cond_false, set_src;
int i; int i;
/* Identify the successor blocks. */ /* Identify the successor blocks. */
...@@ -1898,30 +1897,35 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, ...@@ -1898,30 +1897,35 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
bb_false = bb_true; 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. */ /* Compute which register lead different lives in the successors. */
if (bitmap_operation (diff, bb_true->global_live_at_start, if (bitmap_operation (diff, bb_true->global_live_at_start,
bb_false->global_live_at_start, BITMAP_XOR)) 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); rtx reg = XEXP (cond_true, 0);
if (GET_CODE (reg) == SUBREG) if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg); reg = SUBREG_REG (reg);
if (GET_CODE (reg) != REG) /* We can only track conditional lifetimes if the condition is
abort (); 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));
...@@ -1946,6 +1950,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, ...@@ -1946,6 +1950,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
(splay_tree_value) rcli); (splay_tree_value) rcli);
}); });
} }
}
FREE_REG_SET (diff); FREE_REG_SET (diff);
} }
......
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