[llvm-dev] returns_twice / noreturn

Serge Guelton via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 6 07:07:56 PST 2017

On Sun, Nov 05, 2017 at 09:22:47PM -0500, Yichao Yu via llvm-dev wrote:
> > We do not implement that restricted semantics correctly either -- see
> > https://bugs.llvm.org/show_bug.cgi?id=27190
> Haha, I wondered for a minute whether I should bring up that bug...
> We've seen pretty nasty crashes due to it and had to work around
> it.....
> One of my recent work has also uncovered another (I believe) invalid
> handling of returns_twice functions....
> https://bugs.llvm.org/show_bug.cgi?id=35211
> noalias returns seems to be treated as stack allocation but is not
> required by either LangRef or C standard to be so for returns_twice
> function handling....

For the record, function returning twice are not even correctly
annotated by glibc, see https://sourceware.org/bugzilla/show_bug.cgi?id=20382

Looks like gcc handles that using a pattern matching approach
(see https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01163.html)

Maybe we should do so too?

More information about the llvm-dev mailing list