summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-21 21:59:34 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-21 21:59:34 +0000
commit27f3dbf1ba4b01d4b8751a226fdff226896fde23 (patch)
tree1fa4ffd08de9e492888996917c3d6e158166d429 /gcc/simplify-rtx.c
parent1a3631bc88c877bb4d37b2604d849a55e7760b19 (diff)
downloadgcc-27f3dbf1ba4b01d4b8751a226fdff226896fde23.tar.gz
PR debug/64511
* simplify-rtx.c (simplify_relational_operation_1): Don't try to optimize (eq/ne (and (side_effects) (const_int 0)) (const_int 0)) into (eq/ne (and (not (side_effects)) (const_int 0)) (const_int 0)). * gcc.dg/pr64511.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219974 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index d26267d1717..5c9e3bf1667 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -4589,7 +4589,8 @@ simplify_relational_operation_1 (enum rtx_code code, machine_mode mode,
if ((code == EQ || code == NE)
&& op0code == AND
&& rtx_equal_p (XEXP (op0, 0), op1)
- && !side_effects_p (op1))
+ && !side_effects_p (op1)
+ && op1 != CONST0_RTX (cmp_mode))
{
rtx not_y = simplify_gen_unary (NOT, cmp_mode, XEXP (op0, 1), cmp_mode);
rtx lhs = simplify_gen_binary (AND, cmp_mode, not_y, XEXP (op0, 0));
@@ -4602,7 +4603,8 @@ simplify_relational_operation_1 (enum rtx_code code, machine_mode mode,
if ((code == EQ || code == NE)
&& op0code == AND
&& rtx_equal_p (XEXP (op0, 1), op1)
- && !side_effects_p (op1))
+ && !side_effects_p (op1)
+ && op1 != CONST0_RTX (cmp_mode))
{
rtx not_x = simplify_gen_unary (NOT, cmp_mode, XEXP (op0, 0), cmp_mode);
rtx lhs = simplify_gen_binary (AND, cmp_mode, not_x, XEXP (op0, 1));