https://bugs.llvm.org/show_bug.cgi?id=36441
Bug ID: 36441
Summary: -flto invalidates musttail prerequisites
Product: lld
Version: unspecified
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedb...@nondot.org
Reporter: fe...@indutny.com
CC: llvm-bugs@lists.llvm.org
Created attachment 19906
--> https://bugs.llvm.org/attachment.cgi?id=19906&action=edit
Input LLVM IR
Hello!
I'm working on a project that generates LLVM IR with lots of `musttail` calls.
As I was feeding that IR into `clang` with `-flto` option - I got following
error:
cannot guarantee tail call due to mismatched parameter counts
%15 = musttail call fastcc i8*
@http_parser__invoke_on_complete(%http_parser_state* %0, i8* %14, i8* %2)
cannot guarantee tail call due to mismatched parameter counts
%33 = musttail call fastcc i8*
@http_parser__invoke_on_complete(%http_parser_state* %0, i8* %32, i8* %2)
cannot guarantee tail call due to mismatched parameter counts
%10 = musttail call fastcc i8* @http_parser__method(%http_parser_state* %0,
i8* %1, i8* %2, i32 0)
LLVM ERROR: Broken module found, compilation aborted!
Unfortunately, my attempts to reduce it to a minimal test case have so far been
unsuccessful. Thus please find in an attachment - the IR file that I'm
experiencing the problem is.
It looks like unused function parameters are somehow getting removed by LTO,
likely due to inlining. In turn, the compiler can no longer see that the
parameter count is the same.
I might be able to submit a patch to fix this problem given enough hints on
where to look at.
Thanks,
Fedor.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs