Skip to content
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

Inline asm crash in linux kernel #1254

Closed
llvmbot opened this issue Aug 17, 2006 · 4 comments
Closed

Inline asm crash in linux kernel #1254

llvmbot opened this issue Aug 17, 2006 · 4 comments
Assignees
Labels
backend:X86 bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 17, 2006

Bugzilla Link 882
Resolution FIXED
Resolved on Feb 22, 2010 12:51
Version trunk
OS Linux
Blocks #1234
Reporter LLVM Bugzilla Contributor
CC @lattner

Extended Description

The following test case crashes the X86 backend.

target endian = little
target pointersize = 32
target triple = "i686-pc-linux-gnu"
%str = external global [12 x sbyte] ; <[12 x sbyte]*> [#uses=1]

implementation ; Functions:

void %unknown_bootoption() {
entry:
call void asm sideeffect "ud2\0A\09.word ${0:c}\0A\09.long ${1:c}\0A",
"i,i,{dirflag},{fpsr},~{flags}"( int 235, sbyte* getelementptr ([12 x sbyte]*
%str, int 0, uint 0) )
ret void
}

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 17, 2006

assigned to @lattner

@lattner
Copy link
Collaborator

lattner commented Aug 17, 2006

Evan, this is a bug in the bottom-up selection code.

The problem is that X86GenDAGISel.inc calls SelectInlineAsmMemoryOperands on line 23765.
This method (in SelectionDAGISel.cpp) calls SelectInlineAsmMemoryOperand on memops.  However, these
operands are not getting added to the selection queue, so the X86ISD::Wrapper object never gets selected.

If you won't get to this before you leave, please reassign it back to me.

-Chris

@llvmbot
Copy link
Collaborator Author

llvmbot commented Oct 31, 2006

Looks like there is another bug:

Operand 4 of the inline asm node is an immediate 11. That means operand 5 is
expected to be an immediate as well. But it is a X86ISD::Wrapper of
TargetGlobalAddress <[12 x sbyte]* %str> which would select to a X86::MOVri.
This would still fail.

@lattner
Copy link
Collaborator

lattner commented Oct 31, 2006

Implemented. Testcase here: CodeGen/X86/asm-global-imm.ll

There are several patches, so not listing here.

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead
Projects
None yet
Development

No branches or pull requests

2 participants