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

[inlineasm] earlyclobber modifier is silently ignored #1729

Closed
isanbard opened this issue Apr 25, 2007 · 5 comments
Closed

[inlineasm] earlyclobber modifier is silently ignored #1729

isanbard opened this issue Apr 25, 2007 · 5 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla llvm:codegen miscompilation

Comments

@isanbard
Copy link
Contributor

Bugzilla Link 1357
Resolution FIXED
Resolved on Mar 06, 2010 13:59
Version trunk
OS All
Blocks #1234
Attachments .ll Version of the Program, .c Version of the Program that Aborts

Extended Description

I've attached the .ll file that aborts when run. It's something to do with the inline assembly thingy.

On the plus side, GMP compiled! :-)

@isanbard
Copy link
Contributor Author

assigned to @lattner

@lattner
Copy link
Collaborator

lattner commented Apr 30, 2007

Reduced testcase:

long long test(int A, int B, int C) {
unsigned X, Y;
asm ("subf%I3c %1,%4,%3\nsubfze %0,%2"
: "=r" (X), "=&r" (Y)
: "r" (A), "rI" (B), "r" (C));
return ((long long)Y << 32) | X;
}

We compile this to:

_test:
# InlineAsm Start
subfc r3,r5,r4
subfze r4,r3
# InlineAsm End
stw r3, -4(r1)
blr

Note that the first instruction clobbers r3 before the second instruction uses it.

-Chris

@lattner
Copy link
Collaborator

lattner commented Apr 30, 2007

Fixed. Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070430/048747.html
There are several other required patches to go along with this though.

Testcase here: CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll

-Chris

@isanbard
Copy link
Contributor Author

mentioned in issue llvm/llvm-bugzilla-archive#1374

@asl
Copy link
Collaborator

asl commented Nov 27, 2021

mentioned in issue #1234

@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
bugzilla Issues migrated from bugzilla llvm:codegen miscompilation
Projects
None yet
Development

No branches or pull requests

3 participants