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]>
---
 gcc/testsuite/gcc.dg/torture/pr123745-1.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/torture/pr123745-1.c

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);
+}
-- 
2.43.0

Reply via email to