aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2013-09-11 17:40:56 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2013-09-11 17:40:56 +0000
commit088845a5f0ba6f712c80bdb9a3a3e98c11f5681f (patch)
tree3417a5eb009f0ff6f47061a4f4bd7480639b1100
parent5c2961cf38a69f2579718f369753c7939a7e5ad1 (diff)
downloadgcc-088845a5f0ba6f712c80bdb9a3a3e98c11f5681f.zip
gcc-088845a5f0ba6f712c80bdb9a3a3e98c11f5681f.tar.gz
gcc-088845a5f0ba6f712c80bdb9a3a3e98c11f5681f.tar.bz2
simplify-rtx.c (simplify_unary_operation_1): Use simplify_gen_binary for (not (neg ...)) and (neg (not ...)) cases.
gcc/ * simplify-rtx.c (simplify_unary_operation_1): Use simplify_gen_binary for (not (neg ...)) and (neg (not ...)) cases. From-SVN: r202506
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/simplify-rtx.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5e9b207..bbe5479 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * simplify-rtx.c (simplify_unary_operation_1): Use simplify_gen_binary
+ for (not (neg ...)) and (neg (not ...)) cases.
+
2013-09-11 Richard Biener <rguenther@suse.de>
PR middle-end/58377
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 9ec41a5..432842e 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -825,7 +825,8 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
/* Similarly, (not (neg X)) is (plus X -1). */
if (GET_CODE (op) == NEG)
- return plus_constant (mode, XEXP (op, 0), -1);
+ return simplify_gen_binary (PLUS, mode, XEXP (op, 0),
+ CONSTM1_RTX (mode));
/* (not (xor X C)) for C constant is (xor X D) with D = ~C. */
if (GET_CODE (op) == XOR
@@ -932,7 +933,8 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
/* Similarly, (neg (not X)) is (plus X 1). */
if (GET_CODE (op) == NOT)
- return plus_constant (mode, XEXP (op, 0), 1);
+ return simplify_gen_binary (PLUS, mode, XEXP (op, 0),
+ CONST1_RTX (mode));
/* (neg (minus X Y)) can become (minus Y X). This transformation
isn't safe for modes with signed zeros, since if X and Y are