https://gcc.gnu.org/g:2b8f467110315958b67909b5fef81209ec4ce3c6
commit r17-2109-g2b8f467110315958b67909b5fef81209ec4ce3c6 Author: Oleg Endo <[email protected]> Date: Fri Jul 3 15:05:54 2026 +0900 SH: Add test case for PR81426 gcc/testsuite/ChangeLog: PR target/81426 * gcc.target/sh/pr81426.c: New test. Diff: --- gcc/testsuite/gcc.target/sh/pr81426.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gcc/testsuite/gcc.target/sh/pr81426.c b/gcc/testsuite/gcc.target/sh/pr81426.c new file mode 100644 index 000000000000..0f4c26d205eb --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/pr81426.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { atomic_model_soft_gusa_available } } } */ +/* { dg-options "-O2 -fPIC -matomic-model=soft-gusa,strict" } */ + +inline int a (char *b, char c) +{ + __sync_val_compare_and_swap (b, c, 0); +} + +int d(void) +{ + while (1) + { + char e; + a(&e, e); + } +} \ No newline at end of file
