-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Statics should not be able to take the address of a thread_local static #18712
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
Comments
I'm now getting zero even with |
Ah I believe this is still an issue, the results here should be deterministic. The right answer is happening in the optimized case I believe due to LLVM being able to inline everything. |
Oh, I was getting zero in all cases no matter what. how do you trigger the bug? |
Interesting, if I compile without optimizations then I get the bogus answer above. That being said, this is semantically just not a correct operation as there is no statically known global value for the address of a thread local (it varies per thread!) |
Triage: updated code:
I still get zero in both cases here. |
This bug is still present. Updated title to correspond to the fact that statics can reference thread locals, but they shouldn't be able to. |
This has now been fixed on nightly |
Not sure if this is a codegen bug or just something that's not supported by LLVM
The text was updated successfully, but these errors were encountered: