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


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au


--- Comment #1 from Don <clugd...@yahoo.com.au> 2010-07-12 07:58:26 PDT ---
Reduced test case. The for loop never runs, and gets optimized away, yet it
still corrupts the code. The struct must be large enough that it doesn't fit in
a register. The bug can be disabled in gloop.c, intronvars(), by commenting out
line 2873, but I'm not yet sure what the root cause is. Probably failing to
copy all of the data into the newly created variable.
---
struct Struct4443
{
    int x;
    char[5] unused;
}

void foo4443(Struct4443[] arr, Struct4443 *dest)
{
    for (int i = 0; false; ) {
        int junk = arr[i].x;
    }
    if (dest || arr[$-1].x) {
        *dest = arr[$-1];
    }
}

void main()
{
    Struct4443[1] a;
    Struct4443 info;
    foo4443(a, &info);
}

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

Reply via email to