[PATCH] string: Drop always_inline from tst-xbzero-opt [BZ #23130]
Stian Halseth
stian@itx.no
Fri Sep 25 10:43:37 GMT 2026
Hi,
This fixes the tst-xbzero-opt build break on RISC-V from a066c5d7d; no
comments since it went out on Monday.
Adhemerval, could you push it? I do not have commit access. Andreas, if
you can confirm it builds on RISC-V, that would be good to have on the
record.
Best regards,
Stian
On Mon, 2026-09-21 at 22:39 +0200, Stian Halseth wrote:
> Commit a066c5d7d keeps always_inline on prepare_test_buffer unless
> the
> compiler lacks indirect_return, as a proxy for swapcontext not being
> returns_twice. GCC has indirect_return on RISC-V, which uses the
> generic bits/indirect-return.h, so the test asks to inline a caller
> of
> a returns_twice function and fails to build:
>
> tst-xbzero-opt.c:122:1: error: function 'prepare_test_buffer' can
> never be inlined because it uses setjmp
>
> Remove the attribute and the condition around it.
>
> Tested on x86_64 and sparc64.
>
> Reported-by: Andreas Schwab <schwab@suse.de>
> Signed-off-by: Stian Halseth <stian@itx.no>
> ---
> string/tst-xbzero-opt.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/string/tst-xbzero-opt.c b/string/tst-xbzero-opt.c
> index 26e2ec1c13..dfe0d39879 100644
> --- a/string/tst-xbzero-opt.c
> +++ b/string/tst-xbzero-opt.c
> @@ -111,14 +111,7 @@ use_test_buffer (unsigned char *buf)
> /* Always check the test buffer immediately after filling it; this
> makes externally visible side effects depend on the buffer
> existing
> and having been filled in. */
> -#if !__glibc_has_attribute (__indirect_return__)
> -/* Without indirect_return, swapcontext is marked returns_twice,
> which
> - prevents always_inline from working. */
> -# define ALWAYS_INLINE
> -#else
> -# define ALWAYS_INLINE __attribute__ ((always_inline))
> -#endif
> -static inline ALWAYS_INLINE void
> +static inline void
> prepare_test_buffer (unsigned char *buf)
> {
> for (unsigned int i = 0; i < PATTERN_REPS; i++)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20260925/2fe86b13/attachment.sig>
More information about the Libc-alpha
mailing list