[Issue 3633] New: Optimizer causes access violation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 18 17:09:04 PST 2009


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

           Summary: Optimizer causes access violation
           Product: D
           Version: 1.033
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: janzert at janzert.com
                CC: janzert at janzert.com


--- Comment #0 from Janzert <janzert at janzert.com> 2009-12-18 17:09:02 PST ---
The following throws an Access Violation exception under windows when compiled
with dmd -release -O

int get_value()
{
    return 1;
}

int[2] array1;
int[2] array2;

int test(ulong a1, ulong extra, ulong extra2, ulong extra3)
{
    if (!((a1 & 1) | (get_value() | array1[a1^1])))
        return 0;

    if (0 >= array2[a1^1])
        return 0;

    return 1;
}

void main(char[][] args)
{
    test(0, 0, 0, 0);
}

Tested with dmd 1.033, 1.041, 1.043, 1.053

-- 
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