]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Add testcase for already fix bug [PR123745]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Thu, 22 Jan 2026 01:16:04 +0000 (17:16 -0800)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Thu, 22 Jan 2026 01:20:10 +0000 (17:20 -0800)
PR 123745 was fixed by r16-6742-g939dd2324e0f1c7cac4 but
this adds another testcase which shows the same issue.

Pushed as obvious after testing the testcase on x86_64-linux-gnu.

PR tree-optimization/123745

gcc/testsuite/ChangeLog:

* gcc.dg/torture/pr123745-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/testsuite/gcc.dg/torture/pr123745-1.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/torture/pr123745-1.c b/gcc/testsuite/gcc.dg/torture/pr123745-1.c
new file mode 100644 (file)
index 0000000..dd5bbc9
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* PR tree-optimization/123745 */
+
+struct b {
+  unsigned long c;
+  unsigned long d;
+};
+void l(struct b *);
+typedef int v4i __attribute__((vector_size(4*sizeof(int))));
+v4i t;
+v4i t1;
+void m(int n) {
+  struct b o;
+  v4i t2 = t;
+  t1 = t2;
+  o.d = 1LU << n;
+  unsigned long g = t2[0];
+  o.c = g << n;
+  l(&o);
+}