[PATCH 16/39] tst-printf-bz18872.sh: stdio: Use __attribute__ ((optnone)) for Clang

Sam James sam@gentoo.org
Sun Dec 22 04:32:49 GMT 2024


"H.J. Lu" <hjl.tools@gmail.com> writes:

> From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
>
> Use
>
> __attribute__ ((optnone))
>
> instead of
>
> __attribute__ ((optimize ("-O0")))
>
> to disable optimization for Clang.

Reviewed-by: Sam James <sam@gentoo.org>

>
> Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
> ---
>  stdio-common/tst-printf-bz18872.sh | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/stdio-common/tst-printf-bz18872.sh b/stdio-common/tst-printf-bz18872.sh
> index 3b283f49a6..ade4b61f85 100644
> --- a/stdio-common/tst-printf-bz18872.sh
> +++ b/stdio-common/tst-printf-bz18872.sh
> @@ -31,7 +31,11 @@ cat <<'EOF'
>    Compile do_test without optimization: GCC 4.9/5.0/6.0 takes a long time
>    to build this source. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67396  */

The GCC bug claims that 6 works fine. We should revisit this if/when we
increase the baseline.

>  
> +#ifdef __clang__
> +__attribute__ ((optnone))
> +#else
>  __attribute__ ((optimize ("-O0")))
> +#endif

OK.

>  int do_test (void)
>  {
>      mtrace ();


More information about the Libc-alpha mailing list