Skip to content

Miscompile with [[clang::musttail]] #72390

@gerben-stavenga

Description

@gerben-stavenga

When adding [[clang::musttail]] to a tail function call the program crashes. Inspection of the output asm clearly shows the stack return address is written over by a skewed memcpy, it copies the struct that is passed on the stack over itself but with a shift of 16 globbering the return address. Without [[clang::musttail] the function runs correctly and -fsanitize=undefined,asan does not indicate any problems

https://godbolt.org/z/Y7fq1xK54

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions