public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28141] thread-local ptr initialized to address of thread-local misclassified as non-constant initializer
[not found] <bug-28141-4@http.gcc.gnu.org/bugzilla/>
@ 2024-04-03 23:20 ` pinskia at gcc dot gnu.org
0 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-03 23:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28141
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |WONTFIX
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is a won't fix as the C11's thread_local does not allow for it either.
C++'s thread_local does but that is because it allows dynamically
initialization; just like global variables in C++.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/28141] thread-local ptr initialized to address of thread-local misclassified as non-constant initializer
2006-06-23 6:55 [Bug c/28141] New: " gary at intrepid dot com
2006-06-23 7:04 ` [Bug c/28141] " pinskia at gcc dot gnu dot org
@ 2006-06-23 16:48 ` gary at intrepid dot com
1 sibling, 0 replies; 3+ messages in thread
From: gary at intrepid dot com @ 2006-06-23 16:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from gary at intrepid dot com 2006-06-23 16:44 -------
I agree this is definitely an enhancement, but will note the following:
1. On Fedora Core 5, x86_64, I was able to successfully link and run
a null program (written in assembly) that initializes thread local
'ptr' that points to thread local 'data'. The declarations appear
as follows:
.globl data
.section .tbss,"awT",@nobits
.align 8
.type data, @object
.size data, 8
data:
.zero 8
.globl ptr
.align 8
.type ptr, @object
.size ptr, 8
ptr:
.quad data
I didn't run extensive tests to verify this was doing the right thing, but
there were no complaints from the linker.
2. Given that __thread is an extension, we could choose to interpret
"constancy", as "constant from the perspective of the currently executing
thread" without doing much harm to "C" semantics.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28141
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/28141] thread-local ptr initialized to address of thread-local misclassified as non-constant initializer
2006-06-23 6:55 [Bug c/28141] New: " gary at intrepid dot com
@ 2006-06-23 7:04 ` pinskia at gcc dot gnu dot org
2006-06-23 16:48 ` gary at intrepid dot com
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-23 7:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-06-23 06:55 -------
I think this needs also a binutils change and technically it is not a constant
as it does change between threads.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28141
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-03 23:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-28141-4@http.gcc.gnu.org/bugzilla/>
2024-04-03 23:20 ` [Bug c/28141] thread-local ptr initialized to address of thread-local misclassified as non-constant initializer pinskia at gcc dot gnu.org
2006-06-23 6:55 [Bug c/28141] New: " gary at intrepid dot com
2006-06-23 7:04 ` [Bug c/28141] " pinskia at gcc dot gnu dot org
2006-06-23 16:48 ` gary at intrepid dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).