Message ID | 20241222000509.2205895-17-hjl.tools@gmail.com |
---|---|
State | Accepted |
Commit | d085db5b57c71c3ee2fbfc38a4f7e2158abeb1d4 |
Headers | show |
Series | [01/39] conform: Use -dD instead of -dN on compiler invocation | expand |
"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 ();
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 */ +#ifdef __clang__ +__attribute__ ((optnone)) +#else __attribute__ ((optimize ("-O0"))) +#endif int do_test (void) { mtrace ();
From: Adhemerval Zanella <adhemerval.zanella@linaro.org> Use __attribute__ ((optnone)) instead of __attribute__ ((optimize ("-O0"))) to disable optimization for Clang. Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> --- stdio-common/tst-printf-bz18872.sh | 4 ++++ 1 file changed, 4 insertions(+)