On Dez 05 2024, Jakub Jelinek wrote:

> --- gcc/testsuite/c-c++-common/toplevel-asm-1.c.jj    2024-11-01 
> 15:09:46.209708353 +0100
> +++ gcc/testsuite/c-c++-common/toplevel-asm-1.c       2024-11-01 
> 19:25:47.512567789 +0100
> @@ -0,0 +1,25 @@
> +/* PR c/41045 */
> +/* { dg-do compile } */
> +/* { dg-options "-O0" } */
> +/* { dg-additional-options "-fno-pie" { target pie } } */
> +
> +struct S { char a; long long b; int c; };
> +enum E { E0, E1 = sizeof (struct S) + 15 };
> +int v[42];
> +void foo (void) {}
> +
> +asm ("# %0 %1 %2 %c3 %c4 %5 %% %="
> +     :: "i" (sizeof (struct S)),
> +     "i" (__builtin_offsetof (struct S, c)),
> +     "i" (E1),
> +     "s" (foo),
> +     "i" (v),
> +/* Not all targets can satisfy "m" even in non-pic code.  */
> +#if !defined(__i386__) && !defined(__x86_64__)
> +     "s" (v));
> +#else
> +     "m" (v));
> +asm ("# %0 %1"
> +     : "=m" (v[16])
> +     : "m" (v[41]));
> +#endif

That fails on riscv64:

.../toplevel-asm-1.c:11:1: error: invalid 'asm': invalid use of '%c'
.../toplevel-asm-1.c:11:1: error: invalid 'asm': invalid use of '%c'

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Reply via email to