aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2020-06-24 19:18:03 +0000
committerSegher Boessenkool <segher@kernel.crashing.org>2020-06-24 19:27:57 +0000
commit0c586913e61021681e3221e8760cd87b24142aea (patch)
treee38ce13f24f1481798513b381d2c9321d71b94c4
parent35eca8c5e16933b5cdb17eac4ed51e6b3877b288 (diff)
downloadgcc-0c586913e61021681e3221e8760cd87b24142aea.zip
gcc-0c586913e61021681e3221e8760cd87b24142aea.tar.gz
gcc-0c586913e61021681e3221e8760cd87b24142aea.tar.bz2
simplify-rtx: Simplify rotates by zero
2020-06-24 Roger Sayle <roger@nextmovesoftware.com> Segher Boessenkool <segher@kernel.crashing.org> * simplify-rtx.c (simplify_unary_operation_1): Simplify rotates by 0.
-rw-r--r--gcc/simplify-rtx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 65008ea..3e913b5 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3645,6 +3645,8 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
case ROTATERT:
case ROTATE:
+ if (trueop1 == CONST0_RTX (mode))
+ return op0;
/* Canonicalize rotates by constant amount. If op1 is bitsize / 2,
prefer left rotation, if op1 is from bitsize / 2 + 1 to
bitsize - 1, use other direction of rotate with 1 .. bitsize / 2 - 1