[Issue 4443] Optimizer produces wrong code for || or && with struct arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 12 13:08:58 PDT 2010


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Optimizer produces wrong    |Optimizer produces wrong
                   |code for statements after   |code for || or && with
                   |loop                        |struct arrays
           Severity|normal                      |critical


--- Comment #2 from Don <clugdbug at yahoo.com.au> 2010-07-12 13:08:53 PDT ---
Further reduction shows that it is unrelated to for loops. Seems to require
either || or && in the if statement.
This bug existed in prehistoric times (tested on DMD0.140).
--------------
struct Struct4443
{
    int x;
    char[5] unused;
}

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

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

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