This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/36801] config/cpu/generic/atomicity_mutex/atomicity.h incorrectly relies on global constructor ordering
- From: "jifl-bugzilla at jifvik dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jul 2008 13:03:24 -0000
- Subject: [Bug libstdc++/36801] config/cpu/generic/atomicity_mutex/atomicity.h incorrectly relies on global constructor ordering
- References: <bug-36801-8116@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from jifl-bugzilla at jifvik dot org 2008-07-11 13:03 -------
On thinking about this a bit more, I think this would be a regression for the
case where __GTHREAD_MUTEX_INIT is used. In the case of
__GTHREAD_MUTEX_INIT_FUNCTION, I believe the previous implementation was also
susceptible to this issue, although in practice, I don't recall ever seeing it
- maybe just luck of link order.
So the __GTHREAD_MUTEX_INIT case can probably be addressed by bringing the
implementation back to the way it was before. I haven't so far thought of a way
to address the __GTHREAD_MUTEX_INIT_FUNCTION case other than the use of
__gthread_once().
I would be tempted to provide a patch, but I don't have a copyright assignment
for GCC (and of course it takes weeks to sort that out).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36801