summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-02 13:19:39 +0000
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-02 13:19:39 +0000
commit75ca193d19857ec8d0c4eb622e06398f15570bfc (patch)
tree3c2ced26891b63a63c680a2b975bfcdff73ef48b
parenta070a3bd270fda31bcc88671ced0e27279e88932 (diff)
downloadppe42-gcc-75ca193d19857ec8d0c4eb622e06398f15570bfc.tar.gz
ppe42-gcc-75ca193d19857ec8d0c4eb622e06398f15570bfc.zip
PR rtl-optimization/15068
* flow.c (init_propagate_block_info): Check condition is reversible. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85439 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/flow.c13
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9393406db64..7dc0a5b503c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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>
* gengtype.h (options::info): Change type to const char *.
diff --git a/gcc/flow.c b/gcc/flow.c
index bf8e61ce3f6..344b48bf223 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -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 cond_true = XEXP (set_src, 0);
rtx reg = XEXP (cond_true, 0);
+ enum rtx_code inv_cond;
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
/* 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 (REG_P (reg)
+ in the form of a reversible comparison of a register against
+ zero. If the condition is more complex than that, then it is
+ safe not to record any information. */
+ inv_cond = reversed_comparison_code (cond_true, BB_END (bb));
+ if (inv_cond != UNKNOWN
+ && REG_P (reg)
&& XEXP (cond_true, 1) == const0_rtx)
{
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),
XEXP (cond_true, 1));
if (GET_CODE (XEXP (set_src, 1)) == PC)
OpenPOWER on IntegriCloud