On Thu, Jul 11, 2024 at 7:19 PM Andrew Pinski <pins...@gmail.com> wrote: > > On Thu, Jul 11, 2024 at 4:14 PM Ian Lance Taylor <i...@golang.org> wrote: > > > > The libbacktrace testsuite was not passing when run with current > > versions of clang. Add the optnone attribute to make it pass. Add > > -Wno-attributes and -Wno-unknown-attributes to disable warnings about > > unrecognized function attributes. Bootstrapped and ran libbacktrace > > testsuite on x86_64-pc-linux-gnu. Committed to mainline. > > NoteI see they have `noclone` and `noinline`, maybe it should have > `noipa` on them too. noipa disables a few more things than > noclone/noinline that might make a difference too. >
Yeah, I was thinking of that, too, perhaps wrapped in a macro like: #if __has_attribute(optnone) # define ATTR_NOOPTS __attribute__ ((noinline, noclone, optnone, unused)) #else # if __has_attribute(noipa) # define ATTR_NOOPTS __attribute__ ((noipa, unused)) # else # define ATTR_NOOPTS __attribute__ ((noinline, noclone, unused)) # endif /* noipa */ #endif /* optnone */ ...and then use that macro in the relevant places. That way it wouldn't be necessary to turn off the warnings from -Wno-attributes and -Wno-unknown-attributes. > Thanks, > Andrew Pinski > > > > > Ian > > > > * btest.c (test1, test3): Add optnone attribute. > > * edtest.c (test1): Likewise. > > * mtest.c (test1, test3): Likewise. > > * configure.ac: Use -Wno-attributes and -Wno-unknown-attributes. > > * configure: Regenerate.