This is the mail archive of the
mailing list for the GCC project.
Re: Optimization of conditional access to globals: thread-unsafe?
> 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.