From ab977fd881b81c9a03ea709fee8b02fb34cd3897 Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Mon, 3 Aug 2015 16:11:20 -0500 Subject: [PATCH] htm.md (tabort.): Restrict the source operand to using a base register. 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 | 5 +++++ gcc/config/rs6000/htm.md | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/powerpc/htm-tabort-no-r0.c | 12 ++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/htm-tabort-no-r0.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8e1df7205b5..eb4a60400b5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-08-03 Peter Bergner + + * config/rs6000/htm.md (tabort.): Restrict the source operand to + using a base register. + 2015-08-03 David Malcolm * main.c (main): Pass in NULL for toplev's external_timer. diff --git a/gcc/config/rs6000/htm.md b/gcc/config/rs6000/htm.md index dbfd0db5962..cec253814d3 100644 --- a/gcc/config/rs6000/htm.md +++ b/gcc/config/rs6000/htm.md @@ -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" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 058c4ec509d..f34d9fd014d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-08-03 Peter Bergner + + * gcc.target/powerpc/htm-tabort-no-r0.c: New test. + 2015-08-03 David Malcolm * 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 index 00000000000..691e5174695 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/htm-tabort-no-r0.c @@ -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); +} -- 2.30.2