Commit 8965ece1 by Paul Brook Committed by Paul Brook

re PR rtl-optimization/15068 (ICE in elim_reg_cond)

	PR rtl-optimization/15068
	* flow.c (init_propagate_block_info): Check condition is reversible.

From-SVN: r85439
parent 9e2878cf
2004-08-02 Paul Brook <paul@codesourcery.com>
PR rtl-optimization/15068
* flow.c (init_propagate_block_info): Check condition is reversible.
2004-08-02 Gabriel Dos Reis <gdr@integrable-solutions.net> 2004-08-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
* gengtype.h (options::info): Change type to const char *. * gengtype.h (options::info): Change type to const char *.
......
...@@ -1865,19 +1865,22 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, ...@@ -1865,19 +1865,22 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
rtx set_src = SET_SRC (pc_set (BB_END (bb))); rtx set_src = SET_SRC (pc_set (BB_END (bb)));
rtx cond_true = XEXP (set_src, 0); rtx cond_true = XEXP (set_src, 0);
rtx reg = XEXP (cond_true, 0); rtx reg = XEXP (cond_true, 0);
enum rtx_code inv_cond;
if (GET_CODE (reg) == SUBREG) if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg); reg = SUBREG_REG (reg);
/* We can only track conditional lifetimes if the condition is /* We can only track conditional lifetimes if the condition is
in the form of a comparison of a register against zero. in the form of a reversible comparison of a register against
If the condition is more complex than that, then it is safe zero. If the condition is more complex than that, then it is
not to record any information. */ safe not to record any information. */
if (REG_P (reg) inv_cond = reversed_comparison_code (cond_true, BB_END (bb));
if (inv_cond != UNKNOWN
&& REG_P (reg)
&& XEXP (cond_true, 1) == const0_rtx) && XEXP (cond_true, 1) == const0_rtx)
{ {
rtx cond_false rtx cond_false
= gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond_true)), = gen_rtx_fmt_ee (inv_cond,
GET_MODE (cond_true), XEXP (cond_true, 0), GET_MODE (cond_true), XEXP (cond_true, 0),
XEXP (cond_true, 1)); XEXP (cond_true, 1));
if (GET_CODE (XEXP (set_src, 1)) == PC) if (GET_CODE (XEXP (set_src, 1)) == PC)
......
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