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

X86 can generate movb al, eax ? #1443

Closed
llvmbot opened this issue Jan 3, 2007 · 1 comment
Closed

X86 can generate movb al, eax ? #1443

llvmbot opened this issue Jan 3, 2007 · 1 comment
Labels
backend:X86 bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead invalid Resolved as invalid, i.e. not a bug

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 3, 2007

Bugzilla Link 1071
Resolution INVALID
Resolved on Feb 22, 2010 12:52
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

While testing this function:

define bool i32() { ret bool true; }

I noticed that it is possible for the X86 backend to generate:

movb al, eax

which doesn't assemble.

To make this happen, go to CodeGen/SelectionISel.cpp in the visitRetInst
function and make it not do an extend (of any kind) for boolean. This will
cause the Legalizer to apply an ANY_EXTEND which, presumably, means that not
doing an extend is okay. While that change is not correct, the X86 backend
shouldn't generate incorrect instructions either.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 3, 2007

Looks like legalizer isn't inserting an anyext to i32 so we ended up with a movb
with a 32-bit register destination.

If you let visitRet insert the anyext node, then it will not generate this
illegal instruction.

@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 invalid Resolved as invalid, i.e. not a bug
Projects
None yet
Development

No branches or pull requests

1 participant