Message ID | 20241222000509.2205895-22-hjl.tools@gmail.com |
---|---|
State | New |
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> > > --- > debug/tst-ssp-1.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/debug/tst-ssp-1.c b/debug/tst-ssp-1.c > index 27f10edc56..671e9a5007 100644 > --- a/debug/tst-ssp-1.c > +++ b/debug/tst-ssp-1.c > @@ -22,6 +22,10 @@ > > static void > __attribute__ ((noinline)) __attribute_noclone__ > +#ifdef __clang__ > +/* Avoid clang optimize it away. */ optimizing > +__attribute__ ((optnone)) > +#endif Also, I don't love the inconsistency here (optnone for Clang vs noinline,noclone for GCC). But at least for GCC, I know SSP depends on some optimisation of course, and I don't know if Clang is different there, so OK. We're trying to err on the side of "only changing Clang" where we can for this, as long as it's clear what should be revisited. Reviewed-by: Sam James <sam@gentoo.org> > test (char *foo) > { > int i;
On Sun, Dec 22, 2024 at 12:40 PM Sam James <sam@gentoo.org> wrote: > > "H.J. Lu" <hjl.tools@gmail.com> writes: > > > From: Adhemerval Zanella <adhemerval.zanella@linaro.org> > > > > --- > > debug/tst-ssp-1.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/debug/tst-ssp-1.c b/debug/tst-ssp-1.c > > index 27f10edc56..671e9a5007 100644 > > --- a/debug/tst-ssp-1.c > > +++ b/debug/tst-ssp-1.c > > @@ -22,6 +22,10 @@ > > > > static void > > __attribute__ ((noinline)) __attribute_noclone__ > > +#ifdef __clang__ > > +/* Avoid clang optimize it away. */ > > optimizing > > > +__attribute__ ((optnone)) > > +#endif > > Also, I don't love the inconsistency here (optnone for Clang vs > noinline,noclone for GCC). But at least for GCC, I know SSP depends on > some optimisation of course, and I don't know if Clang is different Let me revisit it. > there, so OK. We're trying to err on the side of "only changing Clang" > where we can for this, as long as it's clear what should be revisited. > > Reviewed-by: Sam James <sam@gentoo.org> > > > test (char *foo) > > { > > int i;
diff --git a/debug/tst-ssp-1.c b/debug/tst-ssp-1.c index 27f10edc56..671e9a5007 100644 --- a/debug/tst-ssp-1.c +++ b/debug/tst-ssp-1.c @@ -22,6 +22,10 @@ static void __attribute__ ((noinline)) __attribute_noclone__ +#ifdef __clang__ +/* Avoid clang optimize it away. */ +__attribute__ ((optnone)) +#endif test (char *foo) { int i;
From: Adhemerval Zanella <adhemerval.zanella@linaro.org> --- debug/tst-ssp-1.c | 4 ++++ 1 file changed, 4 insertions(+)