Closed Quuxplusone closed 8 years ago
Attached test_bug.ll
(609 bytes, application/octet-stream): llvm test case
Are you using clang to compile C code.
yes it's with clang
I'm not expert but I think the problem is here: (SparcISelLowering:876)
// Otherwise, load it as i64, then do a bitconvert.
SDValue V = DAG.getLoad(MVT::i64, dl, InChain, VAList, NULL, 0);
=> A 64 bit Load is not valid on a 32bits Sparc V8 architecture.
Unfortunately va_arg exists but doesn't really work; we should probably document this somewhere.
The solutions that frontends currently take is the same as with ABI code, they lower it themselves into the appropriate ABI specific code. In this case, no one has written the lowering code for Sparc. This bug is probably really "clang should honor the Sparc ABI"?
_Bug 9244 has been marked as a duplicate of this bug._
Fixed now. (Probably by the commit that added support for 64-bit load/store to the sparcv8 backend a few months ago).
test_bug.ll
(609 bytes, application/octet-stream)