-
Notifications
You must be signed in to change notification settings - Fork 3
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
TLD: invalid initializers for file scope variables #103
Comments
The The source contains:
For which the Berkeley UPC translator generates code with an initializer appropriate only to the initial pthread (though no initializer is actually required at all):
PLUS the initialzier code which sets the right value for any thread:
The translation from clang-upc2c attempts to perform the thread-specific initialization at file scope, and no initialization code:
Also note that the "extern int quux" has been translated to a NON-tentative definition, which is probably not correct in general. |
This appears to be resolved by 4a3b381. |
The dynamic initializers generated for The current problem is that the TLD accessor macro does not appear on the LHS of the following:
The left-hand sides should also be expressions involving UPCR_TLD_ADDR(). |
A possible fix is now in testing. |
Fixed in 59ca342 |
The following error on bug544 indicates that the definition
_upcr_pthreadinfo
is missing, but that is just a symptom rather than the true problem:The clang-upc2c translation of bug544 contains:
The problem lies in the initializers for
pfoo
andpcrazy
, which are themselves thread-specific values (expressions containing addresses of TLD). This produces an error becauseUPCR_TLD_ADDR()
appears in the initializer and accesses the thread-specific_upcr_pthreadinfo
variable, which is instantiated byUPCR_BEGIN_FUNCTION()
.Meanwhile the Berkeley translator produces an error message (or two) instead:
The text was updated successfully, but these errors were encountered: