[Issue 15629] New: [REG] wrong code with "-O -inline" but correct with "-O"
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sat Jan 30 07:01:53 PST 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15629
          Issue ID: 15629
           Summary: [REG] wrong code with "-O -inline" but correct with
                    "-O"
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: gassa at mail.ru
Here is the reduced test case.
testmodule.d:
-----
import std.math;
import std.stdio;
void main ()
{
    int [] a = [3];
    int [] b = [9];
    int value = abs (a[0]);
    if (a[0] != 3)
    {
        writeln (value, " ", a, " ", b);
        assert (false);
    }
}
-----
DMD 2.066.1 through the latest DMD 2.070.0:
- "dmd -O testmodule.d" works,
- "dmd -O -inline testmodule.d" writes "3 [3] [9]" and runs into assert
(false).
DMD 2.063.2:
- both work as expected.
So, technically, this is a regression somewhere between 2.063.2 and 2.066.1.
--
    
    
More information about the Digitalmars-d-bugs
mailing list