This is the mail archive of the
gcc-patches@gcc.gnu.org
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: <e2e108260710260541n61462585u99de9bc0617720f4@mail.gmail.com> <e2e108260710260620k2a2e21b3t1d6c052f14d36094@mail.gmail.com> <20071026143334.GA5041@moonlight.home> <m38x5pj3ig.fsf@localhost.localdomain> <20071026155101.GB5041@moonlight.home> <016201c817e9$5454edd0$2e08a8c0@CAM.ARTIMI.COM> <20071026161739.GC5041@moonlight.home> <Pine.LNX.4.64.0710261836440.23011@wotan.suse.de> <m33avxfu2i.fsf@localhost.localdomain> <1193443563.15346.96.camel@rosella.wigram>
skaller writes:
>
> 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.
Andrew.