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

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 864cca51459ef47ea683cacc961b06c928b30992..534bc9b91afaa0734c0b30c73f3e9efebe8b5d1d 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 b7f33030eb9d45bddb32b42811745bf7ee64ee78..915b050b2fbb999c34bdf31260089c05831824d8 100644 (file)
@@ -124,6 +124,7 @@ DEF_OPAQUE_VECTOR_TYPE (BT_OUV4SI, BT_UINT, 4)
 DEF_OPAQUE_VECTOR_TYPE (BT_BV4SI, BT_BINT, 4)
 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)
index 9046cb08f9481cbe770bad111c395fc5e5922ff3..c2f278dc9c33e3a986ba510138b8ca0cf7213be8 100644 (file)
    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)
index b5e2136a3d4b0eddc8877389ac2c443b504e5603..7a8d45f238183cf04c9443aecf72ec90b58320b8 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-04  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/85981
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" } */
+}