aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2020-06-24 18:48:43 +0000
committerSegher Boessenkool <segher@kernel.crashing.org>2020-06-24 19:27:56 +0000
commit35eca8c5e16933b5cdb17eac4ed51e6b3877b288 (patch)
tree5696a217e8b19df2d2fdd0b9c6cbe5bcd6244945 /gcc
parenta16d0924f18046704ef9a4b6d9593718594677f1 (diff)
downloadgcc-35eca8c5e16933b5cdb17eac4ed51e6b3877b288.zip
gcc-35eca8c5e16933b5cdb17eac4ed51e6b3877b288.tar.gz
gcc-35eca8c5e16933b5cdb17eac4ed51e6b3877b288.tar.bz2
simplify-rtx: Parity of parity is parity
2020-06-24 Roger Sayle <roger@nextmovesoftware.com> * simplify-rtx.c (simplify_unary_operation_1): Simplify (parity (parity x)) as (parity x), i.e. PARITY is idempotent.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/simplify-rtx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 28c2dc6..65008ea 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1391,6 +1391,10 @@ simplify_unary_operation_1 (enum rtx_code code, machine_mode mode, rtx op)
GET_MODE (XEXP (op, 0)));
break;
+ case PARITY:
+ /* (parity (parity x)) -> parity (x). */
+ return op;
+
default:
break;
}