[Issue 3521] Optimized code access popped register

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 23 01:57:31 PST 2009


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2009-11-23 01:57:30 PST ---
Reduced test case shows that this is very low level. It's very specific,
changing the expression order slightly will make the problem go away.
The assignment to c gets optimised away, so that it remains as 0.
-------------------------
void bug3521(int *a)
{
    int c = 0;
    *a = 0;
    if (*a == 0 && (*a + (c = 2)) == 2)
        assert(c == 2);
}

void main ()
{
   int x;
   bug3521(&x);
}

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