-
Notifications
You must be signed in to change notification settings - Fork 13.3k
codegen crash with inline asm #14765
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
Comments
Well, it really shouldn't be done that way, but we shouldn't crash either. |
I found similar bug already reported, Closed http://llvm.org/bugs/show_bug.cgi?id=8363 As per last comments in bug 8363, Eric Christopher 2011-06-29 13:16:29 CDT But issue still present. |
There isn't any possible way we can generate sane code for this; "r" means an integer register, and a 64-bit value can't fit into a 32-bit register. That said, both clang and the LLVM backend should be taught to generate a proper error message. |
I tried same code with gcc on arm with hard float, double f2 ()
Generates proper code, |
@ Eli Friedman |
See the discussion on llvmdev; gcc's behavior is weird, but consistent in a usable way for this particular case. |
Yet another testcase -target armv7-linux-gnueabihf: |
https://reviews.llvm.org/D35587 proposed a fix but hasn't been touched for years |
Extended Description
Reported by rajesh viswabramana on llvmdev, I just converted the test to IL:
target triple = "i386-unknown-linux-gnu"
define double @func1() {
entry:
%0 = tail call double asm "", "=r,0,
{dirflag},{fpsr},~{flags}"(double undef)ret double %0
}
$ ./bin/llc test.ll
llc: /home/espindola/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:383: void getCopyToParts(llvm::SelectionDAG &, llvm::DebugLoc, llvm::SDValue, llvm::SDValue *, unsigned int, llvm::EVT, const llvm::Value *, ISD::NodeType): Assertion `(PartVT.isInteger() || PartVT == MVT::x86mmx) && ValueVT.isInteger() && "Unknown mismatch!"' failed.
The text was updated successfully, but these errors were encountered: