[Issue 8095] [64 bit] Wrong code generation with ref parameters, -m64 -O

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 15 04:12:38 PDT 2012


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[64 bit] Wrong code         |[64 bit] Wrong code
                   |generation with ref         |generation with ref
                   |parameters, -m64 -O -inline |parameters, -m64 -O


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2012-05-15 04:14:08 PDT ---
'Reduced' test case doesn't require -inline. This is a pure optimizer bug.
It requires a nested function, but the nested function isn't actually used.

void bug8095(int z, ref int p1, ref int p2, int xxx, ref int p4, ref int p5)
{
    int x = z / 3;
    void never_used()
    {
        p4 = 0;
        int unused = 0;
        if (x == 4) unused = 1;
    }
    if (z >= 0) {
        p1 = 0;
        p4 = 0;
        p5 = 0;
        int c = 0;
        if ( z / 5 )
            c = 1;
        p2 = c;
        x = c;
    }

}

void main()
{
    int  x1, x2, x4, x5;
    bug8095(0, x1, x2, 0, x4, x5);
}

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