This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
But hoisting global in this case doesn't result in a data race, since the loop always accesses global and contains no synchronisation code. If it were only accessed conditionally, as in the examples under "Avoiding Speculation" on that page, then there would be a race in hoisting it, but not for the code you gave; any data races with the hoisting would still have been present without it.
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.
But speculative loads are never a problem. So I'd like to avoid cluttering GCC code with stuff to avoid them. I honestly don't care about diagnostic tools that fail to see if a value read is used or not.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |