summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-17 22:07:51 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-17 22:07:51 +0000
commited869d6569bc24ab5007b946d3e2be6f8fec1761 (patch)
tree89b22e8b379997542e1eaaf88a11e7c7254da0c8 /gcc/combine.c
parent1ce7df12fc46339f7b3ae914bbb7f719320cb13b (diff)
downloadgcc-ed869d6569bc24ab5007b946d3e2be6f8fec1761.tar.gz
ChangeLog:
* combine.c (simplify_if_then_else): Do not replace (if_then_else (ne reg 0) (0) (const_int)) by (reg) if the modes differ. testsuite/ChangeLog: * gcc.dg/20040217-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77988 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 14cd64b1e69..3cf8ae076f1 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -4930,6 +4930,7 @@ simplify_if_then_else (rtx x)
/* (IF_THEN_ELSE (NE REG 0) (0) (8)) is REG for nonzero_bits (REG) == 8. */
if (true_code == NE && XEXP (cond, 1) == const0_rtx
&& false_rtx == const0_rtx && GET_CODE (true_rtx) == CONST_INT
+ && GET_MODE (XEXP (cond, 0)) == mode
&& (INTVAL (true_rtx) & GET_MODE_MASK (mode))
== nonzero_bits (XEXP (cond, 0), mode)
&& (i = exact_log2 (INTVAL (true_rtx) & GET_MODE_MASK (mode))) >= 0)