www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6736] New: ICE (cgcod.c 1672) with alias this and certain structs

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6736

           Summary: ICE (cgcod.c 1672) with alias this and certain structs
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: minor
          Priority: P3
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thecybershadow gmail.com



08:28:32 PDT ---
struct S1
{
    struct S2 // must be 8 bytes in size
    {
        uint a, b;
    }
    S2 s2;
    alias s2 this;
}

void test()
{
    S1 c;
    c = c + c;
}

I'm not sure what's going on - particularly why this even gets to the backend.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 27 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6736


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-invalid-code         |accepts-invalid,
                   |                            |diagnostic, wrong-code
           Priority|P3                          |P2
                 CC|                            |mrmocool gmx.de
           Platform|x86                         |All
         OS/Version|Windows                     |All
           Severity|minor                       |normal



Doesn't ICE with 2.056 anymore, but it compiles and produces senseless code:

_Dmain:
        push    RBP
        mov    RBP,RSP
        sub    RSP,8
        lea    RAX,-8[RBP]
        xor    RCX,RCX
        mov    [RAX],RCX
        lea    RDX,-8[RBP]
        add    RDX,-8[RBP]
        mov    -8[RBP],RDX
        xor    EAX,EAX
        leave
        ret

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 03 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6736


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE (cgcod.c 1672) with     |Regression(2.054): ICE
                   |alias this and certain      |(cgcod.c 1672) with alias
                   |structs                     |this and certain structs
           Severity|normal                      |regression



This is a regression of fixing bug 6546.

The expression c + c runs semantics with alias this expansion in this order:
BinExp::op_overload( c + c )
BinExp::op_overload( c.s2 + c )
BinExp::op_overload( c.s2 + s.s2 )  // no operator overloading
BinExp::typeCombine( c.s2 + s.s2 )  // 1
BinExp::typeCombine( c.s2 + c )     // 2
BinExp::typeCombine( c + c )        // 

And BinExp::typeCombine cause error only when both types of sides are same.


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 03 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6736


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch



https://github.com/D-Programming-Language/dmd/pull/493

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 03 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6736


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



13:06:55 PDT ---
https://github.com/D-Programming-Language/dmd/commit/475bd326462105c4422921aa485aed276597940d

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