diff options
author | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2010-09-24 22:24:05 +0000 |
---|---|---|
committer | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2010-09-24 22:24:05 +0000 |
commit | 8118ef8d3d07eb86b7c562e3062faaf12f892289 (patch) | |
tree | 116f9bc3c7341403d988ead47a6a14089cf6d21b /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 1d35ad62cc71053dc81899ddffa6910d207a3ef9 (diff) | |
download | bcm5719-llvm-8118ef8d3d07eb86b7c562e3062faaf12f892289.tar.gz bcm5719-llvm-8118ef8d3d07eb86b7c562e3062faaf12f892289.zip |
Fix for test/CodeGen/PowerPC/2008-10-17-AsmMatchingOperands.ll crash.
llvm-svn: 114767
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index d971db54d3d..c316ef6c54a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -5434,6 +5434,26 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) { for (unsigned i = 0, e = ConstraintOperands.size(); i != e; ++i) { SDISelAsmOperandInfo &OpInfo = ConstraintOperands[i]; + // If this is an output operand with a matching input operand, look up the + // matching input. If their types mismatch, e.g. one is an integer, the + // other is floating point, or their sizes are different, flag it as an + // error. + if (OpInfo.hasMatchingInput()) { + SDISelAsmOperandInfo &Input = ConstraintOperands[OpInfo.MatchingInput]; + + if (OpInfo.ConstraintVT != Input.ConstraintVT) { + if ((OpInfo.ConstraintVT.isInteger() != + Input.ConstraintVT.isInteger()) || + (OpInfo.ConstraintVT.getSizeInBits() != + Input.ConstraintVT.getSizeInBits())) { + report_fatal_error("Unsupported asm: input constraint" + " with a matching output constraint of" + " incompatible type!"); + } + Input.ConstraintVT = OpInfo.ConstraintVT; + } + } + // Compute the constraint code and ConstraintType to use. TLI.ComputeConstraintToUse(OpInfo, OpInfo.CallOperand, &DAG); |