From: Oleg Endo Date: Fri, 3 Jul 2026 05:13:29 +0000 (+0900) Subject: SH: Add another test case for LRA X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af502246f427f62fff185fceaca2178cbba9a2df;p=thirdparty%2Fgcc.git SH: Add another test case for LRA gcc/testsuite/ChangeLog: PR target/124778 * gcc.target/sh/torture/pr124778.c: New test. --- 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 00000000000..17834ee4380 --- /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; +}