diff options
author | Oleg Endo <olegendo@gcc.gnu.org> | 2018-02-16 13:52:49 +0000 |
---|---|---|
committer | Oleg Endo <olegendo@gcc.gnu.org> | 2018-02-16 13:52:49 +0000 |
commit | d960ab7b8daceba84413b25d91c2410eec1bbde2 (patch) | |
tree | bdc2d0fef3edb983caddaf0691a6a2360da3cb80 | |
parent | be77ba2a461eefdf4a2676b19025f36ec092c598 (diff) | |
download | gcc-d960ab7b8daceba84413b25d91c2410eec1bbde2.zip gcc-d960ab7b8daceba84413b25d91c2410eec1bbde2.tar.gz gcc-d960ab7b8daceba84413b25d91c2410eec1bbde2.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rx/rx.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/rx/pr83831.c | 14 |
4 files changed, 20 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 01ca398..a5d5fde 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-02-16 Oleg Endo <olegendo@gcc.gnu.org> + + PR target/83831 + * config/rx/rx.c (rx_fuse_in_memory_bitop): Convert shift operand + to QImode. + 2018-02-16 Richard Biener <rguenther@suse.de> PR tree-optimization/84037 diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index 0eaf418..de7af86 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 2d98e2e..7cd64bb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-14 Oleg Endo <olegendo@gcc.gnu.org> + + PR target/83831 + * gcc.target/rx/pr83831.c (test_3, test_6): Adjust test cases. + 2018-02-16 Richard Biener <rguenther@suse.de> PR tree-optimization/84417 diff --git a/gcc/testsuite/gcc.target/rx/pr83831.c b/gcc/testsuite/gcc.target/rx/pr83831.c index 1bd1e2b..27d4a89 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 |