]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix some testcases after my computed goto patch
authorAndrew Pinski <apinski@marvell.com>
Wed, 29 Sep 2021 02:01:52 +0000 (02:01 +0000)
committerAndrew Pinski <apinski@marvell.com>
Wed, 29 Sep 2021 08:04:15 +0000 (08:04 +0000)
For some reason I did not see these failures in my testing.
Sorry about that.  Anyways this fixes the testcases by
adding a cast to __INTPTR_TYPE__ and then a cast to void*.

Committed after testing them on x86_64-linux-gnu.

gcc/testsuite/ChangeLog:

* gcc.c-torture/compile/920826-1.c: Fix computed goto.
* gcc.c-torture/compile/pr27863.c: Likewise.
* gcc.c-torture/compile/pr70190.c: Likewise.
* gcc.dg/torture/pr89135.c: Likewise.
* gcc.dg/torture/pr90071.c: Likewise.
* gcc.dg/vect/bb-slp-pr97709.c: Likewise.

gcc/testsuite/gcc.c-torture/compile/920826-1.c
gcc/testsuite/gcc.c-torture/compile/pr27863.c
gcc/testsuite/gcc.c-torture/compile/pr70190.c
gcc/testsuite/gcc.dg/torture/pr89135.c
gcc/testsuite/gcc.dg/torture/pr90071.c
gcc/testsuite/gcc.dg/vect/bb-slp-pr97709.c

index c2d8843c82471c0b33b101e1d438b2476cae106c..2a1754567fa9421113c8abaea5e8d61e241376ee 100644 (file)
@@ -1,3 +1,3 @@
 /* { dg-require-effective-target indirect_jumps } */
 
-f(int*x){goto*(char)*x;}
+f(int*x){goto*(void*)(__INTPTR_TYPE__)(char)*x;}
index 926312e4cea4a445cbee51cbc1e184a2d891ac14..9dc1ab892276bde7684ff915e2d9e86a255c3ca1 100644 (file)
@@ -27,5 +27,5 @@ _loc66:;
 *++esp=(long)&&_loc119;
  _loc119:;
 SetTermStruc:
- goto *(*esp--);
+ goto *(void*)(__INTPTR_TYPE__)(*esp--);
 }
index d3d209ace98718a798bfde1a505826ffb6fd1145..6c57b509f6a5ec9b680160675a0cebcd6ab1b515 100644 (file)
@@ -8,7 +8,7 @@ fn1 ()
   static char a[] = "foo";
   static void *b[] = { &&l1, &&l2 };
   goto *(b[1]);
- l1: goto *(a[0]);
+ l1: goto *(void*)(__INTPTR_TYPE__)(a[0]);
  l2: return 0;
 }
 
index 278303f98a6abc99a3445e8ba61d7c6a4032a596..4cf0533d193cf20f16a33803986fed9fe23444f5 100644 (file)
@@ -28,7 +28,7 @@ h:
          g = foo ();
          *o = g;
          if (c)
-           goto *d;
+           goto *(void*)d;
        }
     }
   goto *i;
index 702c143170e3bf9d0a63ac3acfa34f1e1a770d04..1c4099cefe0c426c328330cd992bdb2994580c44 100644 (file)
@@ -21,6 +21,6 @@ h: ++e;
         goto i;
      }
 f:
-   goto *({ d || e < 0 || e >= 2; });
+   goto *(void*)(__INTPTR_TYPE__)({ d || e < 0 || e >= 2; });
    &e;
 }
index 672807f167c32666cd5de06efc66afa3a4a4798c..d0f3d0512d946a68b4b8e2c584c9f978decf8d40 100644 (file)
@@ -12,7 +12,7 @@ e()
   void *f[] = {&&g, &&h, &&i, &&j};
   int d, c;
 j:
-  goto *a;
+  goto *(void*)(__INTPTR_TYPE__)a;
 g:
   d = 0;
 h: