From d960ab7b8daceba84413b25d91c2410eec1bbde2 Mon Sep 17 00:00:00 2001 From: Oleg Endo Date: Fri, 16 Feb 2018 13:52:49 +0000 Subject: [PATCH] re PR target/83831 ([RX] Unused bclr,bnot,bset insns) gcc/ PR target/83831 * config/rx/rx.c (rx_fuse_in_memory_bitop): Convert shift operand to QImode. gcc/testsuite/ PR target/83831 * gcc.target/rx/pr83831.c (test_3, test_6): Adjust test cases. From-SVN: r257735 --- gcc/ChangeLog | 6 ++++++ gcc/config/rx/rx.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/rx/pr83831.c | 14 ++++++++------ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 01ca398965e..a5d5fdefe8a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-02-16 Oleg Endo + + PR target/83831 + * config/rx/rx.c (rx_fuse_in_memory_bitop): Convert shift operand + to QImode. + 2018-02-16 Richard Biener PR tree-optimization/84037 diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index 0eaf418cd71..de7af86f9b0 100644 --- a/gcc/config/rx/rx.c +++ b/gcc/config/rx/rx.c @@ -3515,7 +3515,7 @@ rx_fuse_in_memory_bitop (rtx* operands, rtx_insn* curr_insn, if (volatile_insn_p (PATTERN (i)) || CALL_P (i)) return false; - emit_insn (gen_insn (mem, operands[1])); + emit_insn (gen_insn (mem, gen_lowpart (QImode, operands[1]))); set_insn_deleted (op2_def.insn); set_insn_deleted (op0_use); return true; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2d98e2e8024..7cd64bb15ff 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-14 Oleg Endo + + PR target/83831 + * gcc.target/rx/pr83831.c (test_3, test_6): Adjust test cases. + 2018-02-16 Richard Biener PR tree-optimization/84417 diff --git a/gcc/testsuite/gcc.target/rx/pr83831.c b/gcc/testsuite/gcc.target/rx/pr83831.c index 1bd1e2b429b..27d4a89cff4 100644 --- a/gcc/testsuite/gcc.target/rx/pr83831.c +++ b/gcc/testsuite/gcc.target/rx/pr83831.c @@ -1,8 +1,8 @@ /* { dg-do compile } */ /* { dg-options "-O1" } */ /* { dg-final { scan-assembler-times "bclr" 6 } } */ -/* { dg-final { scan-assembler-times "bset" 6 } } */ -/* { dg-final { scan-assembler-times "bnot" 6 } } */ +/* { dg-final { scan-assembler-times "bset" 7 } } */ +/* { dg-final { scan-assembler-times "bnot" 7 } } */ void test_0 (char* x, unsigned int y) @@ -29,13 +29,14 @@ test_2 (unsigned int x) } void -test_3 (char* x, unsigned int y) +test_3 (char* x, unsigned int y, unsigned int z) { - /* Expect 4x bset here. */ + /* Expect 5x bset here. */ x[0] |= 0x10; x[1] = y | (1 << 1); x[2] |= 0x10; x[65000] |= 0x10; + x[5] |= 1 << z; } unsigned int @@ -53,13 +54,14 @@ test_5 (unsigned int x) } void -test_6 (char* x, unsigned int y) +test_6 (char* x, unsigned int y, unsigned int z) { - /* Expect 4x bnot here. */ + /* Expect 5x bnot here. */ x[0] ^= 0x10; x[1] = y ^ (1 << 1); x[2] ^= 0x10; x[65000] ^= 0x10; + x[5] ^= 1 << z; } unsigned int -- 2.30.2