re PR target/83831 ([RX] Unused bclr,bnot,bset insns)
authorOleg Endo <olegendo@gcc.gnu.org>
Fri, 16 Feb 2018 13:52:49 +0000 (13:52 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Fri, 16 Feb 2018 13:52:49 +0000 (13:52 +0000)
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
gcc/config/rx/rx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/rx/pr83831.c

index 01ca398965ebea92053a2ff5ec8de44c13e4f079..a5d5fdefe8a7fbb26cbe18c49e3e8818175c25e8 100644 (file)
@@ -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
index 0eaf418cd719d75c7b21f35ac98870c15ee157a6..de7af86f9b0b09e9f3f1777ca1bb3197067a0734 100644 (file)
@@ -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;
index 2d98e2e80249c0f6e58440b4672004431f229dc4..7cd64bb15ffcae584cc040906a672e4d64a4c604 100644 (file)
@@ -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
index 1bd1e2b429bff9a687ed058eaeb4f65516d6963f..27d4a89cff4d238705df43698e085daf1df9fd83 100644 (file)
@@ -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