-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unrecognized opcodes in module level assembly #355
Comments
This does seem to compile in Compiler Explorer. Not sure if this is related to my setup (git checkout on 15/9). |
Did a little digging on this, it looks like this may actually be a LTO bug upstream. They're not instantiating the target CPU when scanning the inline assembly for symbols before LTO occurs (it's the first ""). I'll start looking for an existing issue; if I can't find one, I'll try to make a X86 reproducer and file it upstream. |
Filed llvm/llvm-project#67698 for this upstream. |
So, I did some digging into this upstream, and it looks like this error is partially spurious; the error is emitted, but the compile and link actually does eventually succeed. The only actual effects of this bug, other than the error message, is that module-level inline assembly is no longer scanned for symbol references to feed into the LTO symbol resolution table. This is already the situation for regular inline assembly, so it isn't a tremendous loss. It's in a bit of a sticky situation upstream; a lot of code tends to assume that you can scan module-level inline assembly for symbols without knowing the CPU and feature set, and there are tools that operate on bitcode that couldn't possibly have that information, too. |
Taking this down to p2; it doesn't look like it's likely to be hard blocker on anything, just surprising and annoying, and it's architecturally quite difficult to fix. |
Using non-6502 in module level assembler code I get the following compilation error. Inline and stand-alone assembly is OK.
when using e.g.
mos-mega65-clang++ -mcpu=mos45gs02 asm.cc
and the snippet shown below.The text was updated successfully, but these errors were encountered: