diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-07-19 19:09:59 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-07-19 19:09:59 +0000 |
commit | aba695c7d08cbfdd56bb0ec27dc4a9a1999a5600 (patch) | |
tree | 1bab49de7637f4bcf5760ee6b1b8e630c1db4663 /llvm/lib/CodeGen | |
parent | c8fb7c61a96d4928fa4aabb61a251ad981b826ab (diff) | |
download | bcm5719-llvm-aba695c7d08cbfdd56bb0ec27dc4a9a1999a5600.tar.gz bcm5719-llvm-aba695c7d08cbfdd56bb0ec27dc4a9a1999a5600.zip |
Fix http://llvm.org/bugs/show_bug.cgi?id=4583
Inline asm instructions may have additional <imp-def,kill> register operands.
These operands are not marked with a flag like the normal asm operands, so we
must not assert that there is a flag.
llvm-svn: 76373
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index c6f3e319f2f..8deaa1a35d7 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -732,7 +732,9 @@ isRegTiedToUseOperand(unsigned DefOpIdx, unsigned *UseOpIdx) const { unsigned DefPart = 0; for (unsigned i = 1, e = getNumOperands(); i < e; ) { const MachineOperand &FMO = getOperand(i); - assert(FMO.isImm()); + // After the normal asm operands there may be additional imp-def regs. + if (!FMO.isImm()) + return false; // Skip over this def. unsigned NumOps = InlineAsm::getNumOperandRegisters(FMO.getImm()); unsigned PrevDef = i + 1; @@ -788,7 +790,9 @@ isRegTiedToDefOperand(unsigned UseOpIdx, unsigned *DefOpIdx) const { unsigned FlagIdx, NumOps=0; for (FlagIdx = 1; FlagIdx < UseOpIdx; FlagIdx += NumOps+1) { const MachineOperand &UFMO = getOperand(FlagIdx); - assert(UFMO.isImm() && "Expecting flag operand on inline asm"); + // After the normal asm operands there may be additional imp-def regs. + if (!UFMO.isImm()) + return false; NumOps = InlineAsm::getNumOperandRegisters(UFMO.getImm()); assert(NumOps < getNumOperands() && "Invalid inline asm flag"); if (UseOpIdx < FlagIdx+NumOps+1) |