]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Add test for ICE fixed by r16-4571
authorAlex Coplan <alex.coplan@arm.com>
Thu, 23 Oct 2025 16:06:22 +0000 (16:06 +0000)
committerAlex Coplan <alex.coplan@arm.com>
Fri, 24 Oct 2025 12:58:33 +0000 (13:58 +0100)
I recently ran into an ICE that was fixed by richi's
r16-4571-g1ceda79ca5fe1a1a296624a98de8fd04958fbe55.

This adds a testcase for that fix.

gcc/testsuite/ChangeLog:

* gcc.dg/torture/vect-permute-ice.c: New test.

gcc/testsuite/gcc.dg/torture/vect-permute-ice.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/torture/vect-permute-ice.c b/gcc/testsuite/gcc.dg/torture/vect-permute-ice.c
new file mode 100644 (file)
index 0000000..05a1da5
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* This testcase triggered an ICE that was fixed by
+   g:1ceda79ca5fe1a1a296624a98de8fd04958fbe55.  */
+char *a;
+char c, e;
+_Bool f() {
+  int g, d = 0;
+  for (int h = 0; h < 128; h += 8) {
+    char *b = &a[h];
+    g = e * b[0] + c * b[1] + 2 * b[2] + 3 * b[3] + 4 * b[4] + 5 * b[5] +
+        6 * b[6] + 7 * b[7];
+    d += g;
+  }
+  return d;
+}