[Bug c++/52558] write introduction incorrect wrt the C++11 memory model
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 12 15:01:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52558
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-12 15:01:36 UTC ---
(In reply to comment #1)
> Richi, is this something that should also be fixed for 4.7 as well? There is a
> write to g_2 that is introduced on paths that did not have it. So this is not
> just a load/load data race.
No, we don't want to fix this for 4.7 as this is not a regression.
Yes, LIM only avoids introducing traps, not data-races. This was discussed
in the past already, btw, and we do not want to generally disallow this
optimization. [The C++ memory model is stupid here, it should not treat
every variable raceable but only specially marked ones, oh well ...]
There will be very many other passes that are affected by this, and even more
very many passes that will be affected by load data-races.
You will for example slow down SPEC CPU 2006 quite a bit (though technically
it does not include C++11 benchmarks).
More information about the Gcc-bugs
mailing list