[Issue 9163] std.parallelism broken with extensive optimizations (gdc)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 16 03:59:55 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9163



--- Comment #5 from Iain Buclaw <ibuclaw at ubuntu.com> 2012-12-16 03:59:53 PST ---
(In reply to comment #4)
> (In reply to comment #2)
> > The read/writes just need to be safeguarded by synchronized to prevent any
> > memoization occuring.
> 
> Okay, I admit that this is all just hand-waiving until we finally get at »D
> memory model« spec together (maybe we should just start a wiki page to collect
> ideas), but:
> 
> Why would you think that scalar promotion for the (inlined) function call is
> legal in the first place? To be able to do that, you would have to prove that
> the call to atomicReadUbyte/atomicLoad depends only on thread local state and
> has no global side effects, and I can't see how atomic operations would fit any
> sensible definition of that terms.

Could be something trivial such as the backend somehow deduces that the
function (atomicLoad) is pure.  I'll have a poke round and see what I can did
up.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list