aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.ibm.com>2018-06-05 07:22:24 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2018-06-05 07:22:24 +0000
commit51e00a122fe2784021c012e14851f28f34f06135 (patch)
tree1a6831cc633d8ff70f0aac32a4e2a7b5339c072f
parentd31238cfde0b9e89a4b24e5d37c81aa55d54494b (diff)
downloadgcc-51e00a122fe2784021c012e14851f28f34f06135.zip
gcc-51e00a122fe2784021c012e14851f28f34f06135.tar.gz
gcc-51e00a122fe2784021c012e14851f28f34f06135.tar.bz2
S/390: Fix __builtin_tbeginc signature
The builtin was accidentally defined to have an integer return value. Fixed with the attached patch. gcc/ChangeLog: 2018-06-05 Andreas Krebbel <krebbel@linux.ibm.com> * config/s390/s390-builtin-types.def: Add void function type. * config/s390/s390-builtins.def: Use the function type for the tbeginc builtin. gcc/testsuite/ChangeLog: 2018-06-05 Andreas Krebbel <krebbel@linux.ibm.com> * gcc.target/s390/htm-builtins-compile-4.c: New test. From-SVN: r261183
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/s390/s390-builtin-types.def1
-rw-r--r--gcc/config/s390/s390-builtins.def2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/s390/htm-builtins-compile-4.c10
5 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ebf9dc4..336620f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * config/s390/s390-builtin-types.def: Add void function type.
+ * config/s390/s390-builtins.def: Use the function type for the
+ tbeginc builtin.
+
2018-06-04 Jim Wilson <jimw@sifive.com>
* config/riscv/riscv-protos.h (riscv_expand_epilogue): Change bool arg
diff --git a/gcc/config/s390/s390-builtin-types.def b/gcc/config/s390/s390-builtin-types.def
index 260ad93..2acc55f 100644
--- a/gcc/config/s390/s390-builtin-types.def
+++ b/gcc/config/s390/s390-builtin-types.def
@@ -124,6 +124,7 @@ DEF_OPAQUE_VECTOR_TYPE (BT_BV8HI, BT_BSHORT, 8)
DEF_OPAQUE_VECTOR_TYPE (BT_OV2DI, BT_LONGLONG, 2)
DEF_FN_TYPE_0 (BT_FN_INT, BT_INT)
DEF_FN_TYPE_0 (BT_FN_UINT, BT_UINT)
+DEF_FN_TYPE_0 (BT_FN_VOID, BT_VOID)
DEF_FN_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT)
DEF_FN_TYPE_1 (BT_FN_INT_VOIDPTR, BT_INT, BT_VOIDPTR)
DEF_FN_TYPE_1 (BT_FN_OV4SI_INT, BT_OV4SI, BT_INT)
diff --git a/gcc/config/s390/s390-builtins.def b/gcc/config/s390/s390-builtins.def
index cf174b5..49caa01 100644
--- a/gcc/config/s390/s390-builtins.def
+++ b/gcc/config/s390/s390-builtins.def
@@ -294,7 +294,7 @@
flags: Flags applying to all its variants should be mentioned in the OB_DEF line instead. */
-B_DEF (tbeginc, tbeginc, 0, B_HTM, 0, BT_FN_INT)
+B_DEF (tbeginc, tbeginc, 0, B_HTM, 0, BT_FN_VOID)
B_DEF (tbegin, tbegin, returns_twice_attr, B_HTM, 0, BT_FN_INT_VOIDPTR)
B_DEF (tbegin_nofloat, tbegin_nofloat, returns_twice_attr, B_HTM, 0, BT_FN_INT_VOIDPTR)
B_DEF (tbegin_retry, tbegin_retry, returns_twice_attr, B_HTM, 0, BT_FN_INT_VOIDPTR_INT)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0d7bd34..1fdae08 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2018-06-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * gcc.target/s390/htm-builtins-compile-4.c: New test.
+
2018-06-04 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/store_merging_21.c: New test.
diff --git a/gcc/testsuite/gcc.target/s390/htm-builtins-compile-4.c b/gcc/testsuite/gcc.target/s390/htm-builtins-compile-4.c
new file mode 100644
index 0000000..c3866bd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/htm-builtins-compile-4.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=zEC12 -mzarch" } */
+
+/* A bug in the builtin definition made__builtin_tbeginc to have an
+ integer return argument. */
+void
+must_not_compile1 (void)
+{
+ int rc = __builtin_tbeginc (); /* { dg-error "void value not ignored as it ought to be" } */
+}