www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10624] New: [REG2.064a] ICE with tuple comparison

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

           Summary: [REG2.064a] ICE with tuple comparison
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



The regression was caused by:
https://github.com/D-Programming-Language/dmd/commit/d9c710351028452533241e069bdde9034fc4cde8

Following code causes ICE with -c switch.

$ dmd -c test.d
Internal error: backend\cod3.c 1953

With debug build dmd:

$ dmd -c test.d
DMD v2.064 DEBUG
el:00382D4C cnt=0 cs=0 <  TYbool 00382E64 00382CA4
 el:00382E64 cnt=0 cs=0 *  1 TYstruct 003820D8
  el:003820D8 cnt=1 cs=0 var  TY*  zis
 el:00382CA4 cnt=0 cs=0 *  1 TYstruct 00382C6C
  el:00382C6C cnt=1 cs=0 var  TY*  rhsPA
TYstruct Internal error: backend\cod3.c 1953

struct Msg {}

struct Tuple(Specs...)
{
    Specs expand;
    alias expand this;
}

void main()
{
    Variant data;
    data = Tuple!Msg();

}
struct Variant
{
    ptrdiff_t function() fptr = &handler!(void);

    static ptrdiff_t handler(A : void)()
    {
        return 0;
    }
    static ptrdiff_t handler(A)()
    {
        A* zis;
        A* rhsPA;
        {
            return *zis < *rhsPA ? -1 : 1;
            // Tupple!(Msg) < Tupple!(Msg)
            // Tupple!(Msg).expand < Tupple!(Msg).expand
            // CmpExp(TOKtuple, TOKtuple) is incorrectly compiled in front-end
        }
        return 0;
    }

    Variant opAssign(T)(T rhs)
    {
        fptr = &handler!(T);
        return this;
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 12 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10624


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 12 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10624




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0145856f4cca1b1a3115325b0e5718f07fb0eb62
[REG2.064a] fix Issue 10624 - ICE with tuple comparison

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 16 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10624


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

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


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