https://gcc.gnu.org/g:82085c141729432bc04d5b12a28324cae5ff41b8
commit r16-6965-g82085c141729432bc04d5b12a28324cae5ff41b8 Author: Andrew Pinski <[email protected]> Date: Wed Jan 21 17:16:04 2026 -0800 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 <[email protected]> Diff: --- gcc/testsuite/gcc.dg/torture/pr123745-1.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 000000000000..dd5bbc97012e --- /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); +}
