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] 's' constraint bug #1754

Closed
lattner opened this issue May 3, 2007 · 1 comment
Closed

[inlineasm] 's' constraint bug #1754

lattner opened this issue May 3, 2007 · 1 comment
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm:codegen

Comments

@lattner
Copy link
Collaborator

lattner commented May 3, 2007

Bugzilla Link 1382
Resolution FIXED
Resolved on Feb 22, 2010 12:42
Version trunk
OS All

Extended Description

This testcase:
int x[2] = { 1, 2 };
static inline void attribute((always_inline))
insn1 (int x) {
asm volatile ("" :: "n" (x), "i" (x));
}
static inline void attribute((always_inline))
insn2 (const void *x) {
asm volatile ("%0 %1" :: "s" (x), "i" (x));
}

void foo (void) {
insn2 (&x[1]);
}

Should compile to:

_foo:
_x+4 _x+4
blr

We currently produce:

Invalid operand for inline asm constraint 's'!

-Chris

@lattner
Copy link
Collaborator Author

lattner commented May 3, 2007

Fixed. This exposed several bugs in the arm, x86 and ppc backends which are now fixed. The patch in
common code is here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070430/048970.html

Testcase here: CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll

-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
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm:codegen
Projects
None yet
Development

No branches or pull requests

1 participant