[ARC] Fix tst_movb pattern.
authorClaudiu Zissulescu <claziss@synopsys.com>
Thu, 1 Jun 2017 09:43:10 +0000 (11:43 +0200)
committerClaudiu Zissulescu <claziss@gcc.gnu.org>
Thu, 1 Jun 2017 09:43:10 +0000 (11:43 +0200)
The tst_movb pattern is missing guarding when spitting.

gcc/
2017-06-01  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.md (tst_movb): Add guard when splitting.

testsuite/
2017-06-01  Claudiu Zissulescu  <claziss@synopsys.com>

* gcc.target/arc/pr9001195952.c: New test.

From-SVN: r248783

gcc/ChangeLog
gcc/config/arc/arc.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arc/pr9001195952.c [new file with mode: 0755]

index ce7085b51cab2d9a575730ebada64eab8c32a96c..9ff24c97a3a162b63b13ab798cdca10c68ee0f6f 100644 (file)
@@ -1,3 +1,7 @@
+2017-06-01  Claudiu Zissulescu  <claziss@synopsys.com>
+
+       * config/arc/arc.md (tst_movb): Add guard when splitting.
+
 2017-06-01  Claudiu Zissulescu  <claziss@synopsys.com>
 
        * config/arc/arc.c (arc_can_eliminate): Test against
index 501413854dde7e3c7575df0360c07488c15781fa..9aa9cd7ae2901d3d8835458686ee564127063388 100644 (file)
    (clobber (match_scratch:SI 3 "=X,X,X,X,X,X,Rrq,Rrq,c"))]
   "TARGET_NPS_BITOPS"
   "movb.f.cl %3,%1,%p2,%p2,%s2"
-  "reload_completed
+  "TARGET_NPS_BITOPS && reload_completed
    && (extract_constrain_insn_cached (insn), (which_alternative & ~1) != 6)"
   [(set (match_dup 0) (match_dup 4))])
 
index d8e3952003c12cfe2dec9ec3cf8d68b7c560544d..952bc9328ca7ec9c7884e0c75bb7ef1d5306d0e5 100644 (file)
@@ -1,3 +1,7 @@
+2017-06-01  Claudiu Zissulescu  <claziss@synopsys.com>
+
+       * gcc.target/arc/pr9001195952.c: New test.
+
 2017-06-01  Tom de Vries  <tom@codesourcery.com>
 
        * c-c++-common/pr43395.c: Add dg-require-effective-target label_values.
diff --git a/gcc/testsuite/gcc.target/arc/pr9001195952.c b/gcc/testsuite/gcc.target/arc/pr9001195952.c
new file mode 100755 (executable)
index 0000000..252438d
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { ! { clmcpu } } } */
+/* { dg-options "-mcpu=archs -Os -w -fpic" } */
+
+/* tst_movb split pattern is wrong for anything else than NPS
+   chip.  */
+__bswap_32___bsx() {
+  int a = __builtin_bswap32(__bswap_32___bsx);
+  if (a & 1048575)
+    zlog_warn();
+}