This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Optimization of conditional access to globals: thread-unsafe?
On 26 Oct 2007 14:24:21 -0700, Ian Lance Taylor <iant@google.com> wrote:
> What do people think of this patch? This seems to fix the problem
> case without breaking Michael's case. It basically avoids store
> speculation: we don't write to a MEM unless the function
> unconditionally writes to the MEM anyhow.
I think it couldn't hurt. Providing it as a QOI feature might be
good. However, we should predicate these changes on a -fthread-safe
flag. More and more of these corner cases will start popping up.