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

[clang]: The output result is incorrect after the speculative_load_hardening attribute is added. #62309

Closed
llongint opened this issue Apr 23, 2023 · 3 comments

Comments

@llongint
Copy link
Contributor

cat test.c

#include <stdio.h>

__attribute__((speculative_load_hardening))
int main() {
    unsigned char arr[] = {1,2,3,4,5,6};
    for (char i = 0;i < 6;i++)
        printf("%d", arr[i]);
    printf("\n");
    return 0;
}
$ clang -O0 -lpthread t2.c -o 15
$ ./15

No output is printed. Actually, 123456 should be printed.

Note: My machine is aarch64.

@llongint
Copy link
Contributor Author

Clang 12 doesn't have this problem.

@llongint
Copy link
Contributor Author

Fixed in https://reviews.llvm.org/D150527

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 13, 2023

@llvm/issue-subscribers-backend-aarch64

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

No branches or pull requests

3 participants