This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [cxx-mem-model] disallow load data races (1 of some)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 03/24/11 17:57, Andrew MacLeod wrote:
> My fault for not being specific about it... I tend to just use data race
> as a catch all for all these types of things when talking about them
> with Aldy.
>
> the testcase should have for (x=0; x< limit; x++) sum[x] = global;
> rather than x<5, so that its not a known loop count.
>
> The hoisted load is then not allowed as it become a speculative load of
> 'global' on the main path which would not otherwise have been there.
> When the value of limit < 0, this can cause a load race detection on
> systems with either a software or hardware data race detector.
We generally don't allow this kind of code motion anyway -- though it's
more because we haven't built any kind of analysis to determine that
this kind of speculative load is often profitable and can't result in a
fault.
However, having a switch we can throw to avoid this behaviour (assuming
we add this kind of speculative code motion one day) is, IMHO, a good thing.
Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJNlHzgAAoJEBRtltQi2kC7h24H/1TJ9gdSKfPwjtiKQL7BLraO
yAwvJJJihacO3xM2pkVZIXRVlHwFyqzU03x0ygExMOex3QMuLMByBbpxsk3uQV7t
30xF5MDEdXEmQ7L1jWI7gYXbKZk5lnJhDQKewPePdUbcVzJj3H71SQGP2uWCLMUE
7ToPioN2w3DazoWdnYC/Jqi5JwBLnKpcxkGXQPYbCvqII8W5Xkmlh743Zq5RF7ax
q1nAkRmKdsgIq0SJJNF0GVxdzfOQkt1q7yzR7W74PCG1h6Yam6DNsePSbswDSu46
0gxkqnlGb6dkgx1iCHAS0PtNDAurGVCAOd5rijH1yib7C+P48XLmoF10Y13v82I=
=D+1J
-----END PGP SIGNATURE-----