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

           Summary: Illegal optimization to unsigned right shift (only
                    array)
           Product: D
           Version: 2.030
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: sys0...@msn.com


Illegal optimization to unsigned right shift (only array)

// source code: test.d
import std.stdio;
int main(string[] args)
{
  long   a = -1;
  long[] b = [ -1 ];
  writefln("a   (%X) >>> 1 = %X", a   , (a    >>> 1));
  writefln("b[0](%X) >>> 1 = %X", b[0], (b[0] >>> 1));
  return 0;
}

----
result (compile : dmd test.d)
a   (FFFFFFFFFFFFFFFF) >>> 1 = 7FFFFFFFFFFFFFFF  // OK
b[0](FFFFFFFFFFFFFFFF) >>> 1 = 7FFFFFFFFFFFFFFF  // OK

----
result (compile : dmd -O test.d)
a   (FFFFFFFFFFFFFFFF) >>> 1 = 7FFFFFFFFFFFFFFF  // OK
b[0](FFFFFFFFFFFFFFFF) >>> 1 = FFFFFFFFFFFFFFFF  // NG?

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

Reply via email to