aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-06-05 15:00:14 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2003-06-05 13:00:14 +0000
commit83588a9d9d9a7c47099608a18a1c42f38b33c3dc (patch)
treefb5f321e5453a09f1a662dee871e9bc946902416 /gcc/combine.c
parent6262f66a0b8447d73ef78f83e329a760c3650798 (diff)
downloadgcc-83588a9d9d9a7c47099608a18a1c42f38b33c3dc.zip
gcc-83588a9d9d9a7c47099608a18a1c42f38b33c3dc.tar.gz
gcc-83588a9d9d9a7c47099608a18a1c42f38b33c3dc.tar.bz2
combine.c (simplify_if_then_else): (IF_THEN_ELSE (NE REG 0) (0) (8)) is REG for nonzero_bits (REG) == 8.
* combine.c (simplify_if_then_else): (IF_THEN_ELSE (NE REG 0) (0) (8)) is REG for nonzero_bits (REG) == 8. From-SVN: r67488
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index c470655..d476bf0 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5049,6 +5049,14 @@ simplify_if_then_else (x)
simplify_shift_const (NULL_RTX, ASHIFT, mode,
gen_lowpart_for_combine (mode, XEXP (cond, 0)), i);
+ /* (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
+ && (INTVAL (true_rtx) & GET_MODE_MASK (mode))
+ == nonzero_bits (XEXP (cond, 0), mode)
+ && (i = exact_log2 (INTVAL (true_rtx) & GET_MODE_MASK (mode))) >= 0)
+ return XEXP (cond, 0);
+
return x;
}