[Issue 16651] atomicOp!"-="(ulong, uint) = wrong result/codegen
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Nov 1 06:24:22 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16651
ag0aep6g at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ag0aep6g at gmail.com
Component|dmd |druntime
Hardware|x86_64 |All
OS|Windows |All
--- Comment #1 from ag0aep6g at gmail.com ---
Same happens with -m32 and smaller types:
----
void main()
{
import std.stdio : writeln;
import core.atomic : atomicOp;
shared uint foo = 2;
ubyte bar = 1;
atomicOp!"-="( foo, bar );
writeln( "foo = ", foo ); // foo = 257
}
----
Also happens on Linux.
Looks like a bug in druntime code (core.atomic) rather than dmd. I think it
works with LDC because they've added a path of their own to druntime [1].
[1]
https://github.com/ldc-developers/druntime/blob/049b8efdf0daebcc1cfe690c5cf7585125c1ff72/src/core/atomic.d#L177
--
More information about the Digitalmars-d-bugs
mailing list