[llvm] r180226 - [inline asm] Fix a crasher for an invalid value type/register class.

Chad Rosier mcrosier at apple.com
Thu Apr 25 10:14:48 PDT 2013


On Apr 24, 2013, at 5:04 PM, Eric Christopher <echristo at gmail.com> wrote:

> Testcase and description? That's really not much of a commit message.

Hopefully, r180445 clarifies a few things.

> There's also no corresponding front end commit to diagnose this.
> What's up here?

Now that you have a better description is this something that can be easily diagnosed in the frontend?

 Chad

> 
> -eric
> 
> On Wed, Apr 24, 2013 at 11:53 PM, Chad Rosier <mcrosier at apple.com> wrote:
>> Author: mcrosier
>> Date: Wed Apr 24 17:53:10 2013
>> New Revision: 180226
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=180226&view=rev
>> Log:
>> [inline asm] Fix a crasher for an invalid value type/register class.
>> rdar://13731657
>> 
>> Modified:
>>    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
>> 
>> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=180226&r1=180225&r2=180226&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Apr 24 17:53:10 2013
>> @@ -6171,10 +6171,17 @@ void SelectionDAGBuilder::visitInlineAsm
>>           MatchedRegs.RegVTs.push_back(RegVT);
>>           MachineRegisterInfo &RegInfo = DAG.getMachineFunction().getRegInfo();
>>           for (unsigned i = 0, e = InlineAsm::getNumOperandRegisters(OpFlag);
>> -               i != e; ++i)
>> -            MatchedRegs.Regs.push_back
>> -              (RegInfo.createVirtualRegister(TLI.getRegClassFor(RegVT)));
>> -
>> +               i != e; ++i) {
>> +            if (const TargetRegisterClass *RC = TLI.getRegClassFor(RegVT))
>> +              MatchedRegs.Regs.push_back(RegInfo.createVirtualRegister(RC));
>> +            else {
>> +              LLVMContext &Ctx = *DAG.getContext();
>> +              Ctx.emitError(CS.getInstruction(), "inline asm error: This value"
>> +                            " type register class is not natively supported!");
>> +              report_fatal_error("inline asm error: This value type register "
>> +                                 "class is not natively supported!");
>> +            }
>> +          }
>>           // Use the produced MatchedRegs object to
>>           MatchedRegs.getCopyToRegs(InOperandVal, DAG, getCurDebugLoc(),
>>                                     Chain, &Flag, CS.getInstruction());
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130425/389823f7/attachment.html>


More information about the llvm-commits mailing list