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

[coroutines] Compiler incorrectly caches thread_local address across suspend-points in some scenarios #63022

Closed
fplk0 opened this issue May 31, 2023 · 2 comments
Assignees
Labels
coroutines C++20 coroutines

Comments

@fplk0
Copy link

fplk0 commented May 31, 2023

The compiler (still) caches the thread_local variable addresses across the suspend points.
A supposed fix (which followed the discussion here) landed, and it indeed fixes many of the original issues. Another relevant closed issue on Github is here.

However, it seems that the issue persists and in some cases TLS behavior isn't preserved, with some other parts (likely loop optimizer?..) messing up with the fix, still resulting in TLS variable address being cached.
Here is the example link showing the issue: https://godbolt.org/z/cz3PPqrcW

cc @ChuanqiXu9 as the implementer of the original fix, maybe you have any thoughts on it?.. Thanks for your work on the issue!

@EugeneZelenko EugeneZelenko added coroutines C++20 coroutines and removed new issue labels May 31, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented May 31, 2023

@llvm/issue-subscribers-coroutines

@ChuanqiXu9 ChuanqiXu9 self-assigned this May 31, 2023
@ChuanqiXu9
Copy link
Member

There are several optimizations in the compiler will perform the merging. And my previous fix was to disable the optimizations case by case. So the current issue is an oversight that I didn't catch. I sent https://reviews.llvm.org/D151774 for this. Hope we can fix the problem fundamentally in time. Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coroutines C++20 coroutines
Projects
Status: Done
Development

No branches or pull requests

4 participants