From: Andrew Pinski Date: Thu, 22 Jan 2026 01:16:04 +0000 (-0800) Subject: testsuite: Add testcase for already fix bug [PR123745] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82085c141729432bc04d5b12a28324cae5ff41b8;p=thirdparty%2Fgcc.git testsuite: Add testcase for already fix bug [PR123745] 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 --- diff --git a/gcc/testsuite/gcc.dg/torture/pr123745-1.c b/gcc/testsuite/gcc.dg/torture/pr123745-1.c new file mode 100644 index 00000000000..dd5bbc97012 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr123745-1.c @@ -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); +}