Thread overview
[Issue 1488] New: Bad code generation when using tuple from asm (regression?)
Sep 09, 2007
d-bugmail
[Issue 1488] Bad code generation when using tuple from asm
Sep 13, 2007
d-bugmail
Oct 20, 2007
d-bugmail
September 09, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1488

           Summary: Bad code generation when using tuple from asm
                    (regression?)
           Product: D
           Version: 1.021
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: clugdbug@yahoo.com.au


I believe this used to work with DMD 1.020. Now it definitely generates bad
code.
If you leave off the "int ptr" you get a compile-time segfault (that's bug
#1125).

--------------
int f(X...)(X x)
{
    asm {
//        mov EAX, int ptr x[0];  // OK -- sets EAX = 123
        mov EAX, int ptr x[1];   // sets EAX = 0x80000001.
    }
}

void main()
{
    assert(456 == f(123, 456));
}


-- 

September 13, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1488


clugdbug@yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|regression                  |critical
            Summary|Bad code generation when    |Bad code generation when
                   |using tuple from asm        |using tuple from asm
                   |(regression?)               |
            Version|1.021                       |1.020




------- Comment #1 from clugdbug@yahoo.com.au  2007-09-13 07:03 -------
This isn't actually a regression. It generated bad code in DMD 1.020 too.


-- 

October 20, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1488


braddr@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from braddr@puremagic.com  2007-10-20 03:50 -------
Fixed in 1.022/2.005


--