This is the mail archive of the
mailing list for the GCC project.
Re: Optimization of conditional access to globals: thread-unsafe?
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: skaller <skaller at users dot sourceforge dot net>
- Cc: Ian Lance Taylor <iant at google dot com>, Michael Matz <matz at suse dot de>, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sat, 27 Oct 2007 12:49:39 +0100
- Subject: Re: Optimization of conditional access to globals: thread-unsafe?
- References: <firstname.lastname@example.org> <email@example.com> <20071026143334.GA5041@moonlight.home> <firstname.lastname@example.org> <20071026155101.GB5041@moonlight.home> <016201c817e9$5454edd0$2e08a8c0@CAM.ARTIMI.COM> <20071026161739.GC5041@moonlight.home> <Pine.LNX.email@example.com> <firstname.lastname@example.org> <email@example.com>
> On Fri, 2007-10-26 at 14:24 -0700, Ian Lance Taylor wrote:
> > This is basically a public relations exercise. I doubt this
> > optimization is especially important, so I think it's OK to
> > disable it to keep people happy. Even though the optimization
> > has been there since gcc 3.4 and nobody noticed.
> Most people didn't have multi-core processors then..
It's partly that. It's also that some people, particularly kernel
hackers, are super-paranoid about this sort of thing, and that's all
to the good. The window of vulnerability introduced by this
"optimization" is extremely small -- but it is there.
As far as I can tell from reading the Linux kernel list, almost every
kernel programmer wants this transformation to be removed. I suspect
that most pthreads programmers do too. So yeah, it's mostly a public
relations exercise, but a worthwhile one. I look forward to going to
the kernel list and telling them we've done what they wanted us to do.
They're an important part of our community.