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 assembly memory operands are broken (LLVM-161) #58

Closed
aykevl opened this issue Apr 15, 2022 · 2 comments
Closed

Inline assembly memory operands are broken (LLVM-161) #58

aykevl opened this issue Apr 15, 2022 · 2 comments

Comments

@aykevl
Copy link

aykevl commented Apr 15, 2022

With this C file (test.c):

int foo(int *ptr) {
        int n;
        __asm__ __volatile__("l32i %0, %1" : "=r"(n) : "m"(*ptr));
        return n;
}

I get the following error:

$ llvm-build/bin/clang -c -o test.o -Os test.c --target=xtensa
test.c:3:23: error: unexpected token
        __asm__ __volatile__("l32i %0, %1" : "=r"(n) : "m"(*ptr));
                             ^
<inline asm>:1:12: note: instantiated into assembly here
        l32i a2, 0(a2)
                  ^
1 error generated.

It looks like the inline assembly is incorrect. It it should have emitted l32i a2, a2, 0 instead of l32i a2, 0(a2).

@github-actions github-actions bot changed the title Inline assembly memory operands are broken Inline assembly memory operands are broken (LLVM-161) Apr 15, 2022
@andreisfr
Copy link
Collaborator

@aykevl , thank you for your investigation of this issue, now it is fixed, please use xtensa_release_14.0.0 branch with latest changes

@aykevl
Copy link
Author

aykevl commented May 21, 2022

I can confirm that cherry-picking ee16f02 fixes this issue. Thank you!
Feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants