]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
SH: Add another test case for LRA
authorOleg Endo <olegendo@gcc.gnu.org>
Fri, 3 Jul 2026 05:13:29 +0000 (14:13 +0900)
committerOleg Endo <olegendo@gcc.gnu.org>
Fri, 3 Jul 2026 05:14:42 +0000 (14:14 +0900)
gcc/testsuite/ChangeLog:

PR target/124778
* gcc.target/sh/torture/pr124778.c: New test.

gcc/testsuite/gcc.target/sh/torture/pr124778.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/sh/torture/pr124778.c b/gcc/testsuite/gcc.target/sh/torture/pr124778.c
new file mode 100644 (file)
index 0000000..17834ee
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile }  */
+/* { dg-additional-options "-std=gnu99" }  */
+/* This used to trigger an ICE in decompose_multiword_subregs at -O2.  */
+
+long long g;
+
+void
+f (unsigned n, char *p)
+{
+  long long size = 4 + (long long)n;
+  while (size >= 4)
+    {
+      size -= 4;
+      p += 4;
+    }
+  g += *(unsigned short *)p;
+}