htm.md (tabort.): Restrict the source operand to using a base register.
authorPeter Bergner <bergner@vnet.ibm.com>
Mon, 3 Aug 2015 21:11:20 +0000 (16:11 -0500)
committerPeter Bergner <bergner@gcc.gnu.org>
Mon, 3 Aug 2015 21:11:20 +0000 (16:11 -0500)
gcc/
* config/rs6000/htm.md (tabort.): Restrict the source operand to
using a base register.

gcc/testsuite/
* gcc.target/powerpc/htm-tabort-no-r0.c: New test.

From-SVN: r226532

gcc/ChangeLog
gcc/config/rs6000/htm.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/htm-tabort-no-r0.c [new file with mode: 0644]

index 8e1df7205b5083d1ba68a522fb0a73eb607fb821..eb4a60400b592bf2cab4839e5a3d7216d9152d38 100644 (file)
@@ -1,3 +1,8 @@
+2015-08-03  Peter Bergner  <bergner@vnet.ibm.com>
+
+       * config/rs6000/htm.md (tabort.): Restrict the source operand to
+       using a base register.
+
 2015-08-03  David Malcolm  <dmalcolm@redhat.com>
 
        * main.c (main): Pass in NULL for toplev's external_timer.
index dbfd0db59621210da791d46b9d4677cf6241c31c..cec253814d366ab3f44bb4fbda4177ebef341dcf 100644 (file)
@@ -48,7 +48,7 @@
 
 (define_insn "tabort"
   [(set (match_operand:CC 1 "cc_reg_operand" "=x")
-       (unspec_volatile:CC [(match_operand:SI 0 "gpc_reg_operand" "r")]
+       (unspec_volatile:CC [(match_operand:SI 0 "base_reg_operand" "b")]
                            UNSPECV_HTM_TABORT))]
   "TARGET_HTM"
   "tabort. %0"
index 058c4ec509d93d51a81b20a20c42d3076e53295d..f34d9fd014dfaaa8c21cbbbec7efdd14ecf9f9bf 100644 (file)
@@ -1,3 +1,7 @@
+2015-08-03  Peter Bergner  <bergner@vnet.ibm.com>
+
+       * gcc.target/powerpc/htm-tabort-no-r0.c: New test.
+
 2015-08-03  David Malcolm  <dmalcolm@redhat.com>
 
        * jit.dg/test-benchmark.c (test_jit): Add param "timer" and use
diff --git a/gcc/testsuite/gcc.target/powerpc/htm-tabort-no-r0.c b/gcc/testsuite/gcc.target/powerpc/htm-tabort-no-r0.c
new file mode 100644 (file)
index 0000000..691e517
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_htm_ok } */
+/* { dg-options "-O2 -mhtm -ffixed-r3 -ffixed-r4 -ffixed-r5 -ffixed-r6 -ffixed-r7 -ffixed-r8 -ffixed-r9 -ffixed-r10 -ffixed-r11 -ffixed-r12" } */
+
+/* { dg-final { scan-assembler-not "tabort\\.\[ \t\]0" } } */
+
+int
+foo (void)
+{
+  return __builtin_tabort (10);
+}