From 35eca8c5e16933b5cdb17eac4ed51e6b3877b288 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Wed, 24 Jun 2020 18:48:43 +0000 Subject: [PATCH] simplify-rtx: Parity of parity is parity 2020-06-24 Roger Sayle * simplify-rtx.c (simplify_unary_operation_1): Simplify (parity (parity x)) as (parity x), i.e. PARITY is idempotent. --- gcc/simplify-rtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 28c2dc69ae7..65008eaab45 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; } -- 2.30.2