https://gcc.gnu.org/g:af502246f427f62fff185fceaca2178cbba9a2df

commit r17-2107-gaf502246f427f62fff185fceaca2178cbba9a2df
Author: Oleg Endo <[email protected]>
Date:   Fri Jul 3 14:13:29 2026 +0900

    SH: Add another test case for LRA
    
    gcc/testsuite/ChangeLog:
    
            PR target/124778
            * gcc.target/sh/torture/pr124778.c: New test.

Diff:
---
 gcc/testsuite/gcc.target/sh/torture/pr124778.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gcc/testsuite/gcc.target/sh/torture/pr124778.c 
b/gcc/testsuite/gcc.target/sh/torture/pr124778.c
new file mode 100644
index 000000000000..17834ee43808
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/torture/pr124778.c
@@ -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;
+}

Reply via email to