]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
S/390: Fix __builtin_tbeginc signature
authorAndreas Krebbel <krebbel@linux.ibm.com>
Tue, 5 Jun 2018 14:08:59 +0000 (14:08 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Tue, 5 Jun 2018 14:08:59 +0000 (14:08 +0000)
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>

Backport from mainline
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>

Backport from mainline
2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/htm-builtins-compile-4.c: New test.

From-SVN: r261203

gcc/ChangeLog
gcc/config/s390/s390-builtin-types.def
gcc/config/s390/s390-builtins.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/htm-builtins-compile-4.c [new file with mode: 0644]

index 62fb9858873116f2fe03c8a0ae0bcb22c38506c6..aee7fdd54bf3a62060cb09b34405a5077f18ac88 100644 (file)
@@ -1,3 +1,12 @@
+2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>
+
+       Backport from mainline
+       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-01  Bill Schmidt  <wschmidt@linux.ibm.com>
 
        PR tree-optimization/85712
index f5fcf986c8fb8ef43518ad635c123f6de078b791..28e107c291064a5ec4b47db1e4d78fba26a70e3c 100644 (file)
@@ -129,6 +129,7 @@ DEF_OPAQUE_VECTOR_TYPE (BT_BV2DI, B_VX, BT_BLONGLONG, 2)
 DEF_OPAQUE_VECTOR_TYPE (BT_BV8HI, B_VX, BT_BSHORT, 8)
 DEF_FN_TYPE_0 (BT_FN_INT, B_HTM, BT_INT)
 DEF_FN_TYPE_0 (BT_FN_UINT, 0, BT_UINT)
+DEF_FN_TYPE_0 (BT_FN_VOID, B_HTM, BT_VOID)
 DEF_FN_TYPE_1 (BT_FN_INT_INT, B_VX, BT_INT, BT_INT)
 DEF_FN_TYPE_1 (BT_FN_INT_VOIDPTR, B_HTM, BT_INT, BT_VOIDPTR)
 DEF_FN_TYPE_1 (BT_FN_OV4SI_INT, B_VX, BT_OV4SI, BT_INT)
index 4bcdb22d529f5a57abfd7439027d992955f9a220..612342d2ecbe1e5b7ee686bd2ad62e3e87b335be 100644 (file)
    OB_DEF_VAR (<variant name>, <standard builtin name>, <flags>, <fntype>) */
 
 
-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)
index e21528939c4230fcf3ad968a336a768ca3e0e0c7..b769f11f3f46de7a99e636cf3650059a55e5d0b4 100644 (file)
@@ -1,3 +1,10 @@
+2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>
+
+       Backport from mainline
+       2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>
+
+       * gcc.target/s390/htm-builtins-compile-4.c: New test.
+
 2018-06-02  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/discr53.ad[sb]: 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 (file)
index 0000000..c3866bd
--- /dev/null
@@ -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" } */
+}