[Issue 18643] New: Compiling error when combining CAS and numeric literal.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 21 06:44:50 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18643

          Issue ID: 18643
           Summary: Compiling error when combining CAS and numeric
                    literal.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: lempiji at gmail.com

This code can’t be compiled.
The problem only occurs on Linux. It works normally on Windows and OSX.

----------
import core.atomic;

void main()
{
    shared(size_t) count;
    cas(&count, count, 0); // NG
    cas(&count, count, cast(size_t)0); // OK
}
----------

The error message:
----------
/home/travis/dlang/dmd-2.079.0/linux/bin64/../../src/druntime/import/core/atomic.d(937,35):
Error: bad type/size of operands mov
----------

--


More information about the Digitalmars-d-bugs mailing list