[PATCH v2 5/6] Eliminate CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT

Nicolas Schier nsc at kernel.org
Thu Nov 12 03:34:50 PST 2026


On Wed, Nov 11, 2026 at 05:52:07PM -0700, Nathan Chancellor wrote:
> Commit 1aa0e8b144b6 ("Kconfig: Add option for asm goto w/ tied outputs
> to workaround clang-13 bug") added CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT to
> avoid a bug in clang's asm goto with outputs support when a tied output
> was used. The fix in clang was to match GCC's documented behavior.
> 
> Now that the minimum supported version of clang has long been bumped
> past the version where the fix landed (clang-14), any compiler that
> satisfies the dependencies of CONFIG_CC_HAS_ASM_GOTO_OUTPUT will support
> tied outputs properly. Eliminate CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT in
> favor of just checking for CONFIG_CC_HAS_ASM_GOTO_OUTPUT directly.
> 
> Signed-off-by: Nathan Chancellor <nathan at kernel.org>
> ---

[...]
> diff --git a/scripts/Kconfig.toolchain b/scripts/Kconfig.toolchain
> index 6520a06a9103..9454ef5294d5 100644
> --- a/scripts/Kconfig.toolchain
> +++ b/scripts/Kconfig.toolchain
> @@ -120,11 +120,6 @@ config CC_HAS_ASM_GOTO_OUTPUT
>  	depends on !GCC_ASM_GOTO_OUTPUT_BROKEN
>  	depends on $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
>  
> -config CC_HAS_ASM_GOTO_TIED_OUTPUT
> -	depends on CC_HAS_ASM_GOTO_OUTPUT
> -	# Detect buggy gcc and clang, fixed in gcc-11 clang-14.
> -	def_bool $(success,echo 'int foo(int *x) { asm goto (".long (%l[bar]) - .": "+m"(*x) ::: bar); return *x; bar: return 0; }' | $CC -x c - -c -o /dev/null)

The comments reads as if gcc 8 to 10 are affected.  Is the comment
somehow misleading, or should we still keep this until gcc-10 is the
minimum gcc version?

-- 
Nicolas



More information about the linux-riscv mailing list