[cfe-dev] naked attribute

Anton Korobeynikov anton at korobeynikov.info
Thu May 9 08:19:37 PDT 2013


> They would get the unreachable instructions and the emit prologue/epilogue
> would not be called. This has the advantage of enforcing a unifying
> semantics for this across llvm, with the negative of not doing the same
> thing gcc would do, which is to allow the backend ports to ignore the naked attribute.
I do not see anything negative here. In LLVM world you can implement
everything in target-neutral way. Backends are effectively not
involved here. In GCC world one need to implement this features on
per-backend basis.

This is why all that mess and missed support in GCC for some
architectures (some of which is merely "maintainer does not like this
stuff").

So, I do not see point of being compatible with GCC when we need *not*
to implement something in order to be compatible. We do not need to be
bug-to-bug compatible with GCC, esp. when the GCC's behavior is
definitely weird, messy and not logical at all.

PS: Though, I must admit that 'naked' attribute is a mess by itself as well :)

--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the cfe-dev mailing list