Jump to page: 1 2
Thread overview
[Issue 5590] New: ICE when using .values on enum which is associative array
Feb 15, 2011
Jonathan M Davis
Mar 14, 2011
kennytm@gmail.com
Apr 28, 2011
Don
Sep 06, 2011
yebblies
[Issue 5590] ICE(e2ir.c): when using .values on enum which is associative array
Feb 02, 2012
yebblies
Feb 07, 2012
Walter Bright
Feb 07, 2012
yebblies
[Issue 5590] Regression(2.036) ICE(e2ir.c): when using .values on enum which is associative array
Feb 09, 2012
Don
Feb 09, 2012
yebblies
Mar 03, 2012
Walter Bright
February 15, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5590

           Summary: ICE when using .values on enum which is associative
                    array
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: jmdavisProg@gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisProg@gmx.com> 2011-02-15 02:26:28 PST ---
On dmd 2.051, this code

import std.path;
import std.range;

enum aa = [5 : "hello"];

void main(string[] args)
{
    auto a = aa.values.front;
}


fails to compile, giving this error: Internal error: e2ir.c 4617 With the current beta, it gives: Internal error: e2ir.c 4835

This may or may not be a duplicate of bug# 4460. I don't know enough about the compiler details to know for sure, but it does seem similar. It's definitely not quite the same circumstances though, so I'm creating a new bug just in case it is something separate.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 14, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5590


kennytm@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #1 from kennytm@gmail.com 2011-03-14 16:33:10 PDT ---
*** Issue 5734 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 28, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5590


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug@yahoo.com.au
         Resolution|                            |DUPLICATE


--- Comment #3 from Don <clugdbug@yahoo.com.au> 2011-04-28 08:41:30 PDT ---
*** This issue has been marked as a duplicate of issue 4460 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 06, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5590


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |yebblies@gmail.com
           Platform|x86                         |All
         Resolution|DUPLICATE                   |
         OS/Version|Linux                       |All


--- Comment #4 from yebblies <yebblies@gmail.com> 2011-09-06 19:10:00 EST ---
Not a duplicate, but probably related.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 02, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5590


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
            Version|unspecified                 |D2
           Severity|normal                      |regression


--- Comment #5 from yebblies <yebblies@gmail.com> 2012-02-02 20:40:11 EST ---
https://github.com/D-Programming-Language/dmd/pull/685

Regression as this used to work before AssociativeArray was added to object.d. The old code is still there in TypeAArray::dotExp, and still works.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5590


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com


--- Comment #6 from Walter Bright <bugzilla@digitalmars.com> 2012-02-06 19:51:50 PST ---
Clearly, the AA solution in D needs some re-engineering, so I'm going to have to defer fixing this for the moment.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5590



--- Comment #7 from yebblies <yebblies@gmail.com> 2012-02-07 15:02:53 EST ---
(In reply to comment #6)
> Clearly, the AA solution in D needs some re-engineering, so I'm going to have to defer fixing this for the moment.

This is also fixed by rolling back the AA implementation.

https://github.com/D-Programming-Language/dmd/pull/688 https://github.com/D-Programming-Language/druntime/pull/143

If this is pulled (which I think it should be) this bug report can be closed. Pull 688 contains test cases for this bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 09, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5590


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE(e2ir.c): when using     |Regression(2.036)
                   |.values on enum which is    |ICE(e2ir.c): when using
                   |associative array           |.values on enum which is
                   |                            |associative array


--- Comment #8 from Don <clugdbug@yahoo.com.au> 2012-02-09 07:49:20 PST ---
Although this is a regression, it isn't recent. It last worked in 2.035 Minimal test case is:

enum aa = [5 : "hello"];

void bug5520()
{
    auto a = aa.values;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 09, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5590



--- Comment #9 from yebblies <yebblies@gmail.com> 2012-02-10 03:20:09 EST ---
For anyone interested in why this bug exists:

When the 'aa' of 'aa.values' reaches e2ir, it is an 'ArrayLiteralExp' but is typed as the 'AssociativeArray' struct, because the type is changed in order to do member lookup.  Changing the type back to an AA doesn't work, I assume because _d_assocarrayliteralTX returns a reference to an associative array and the compiler gets very confused about where it's actually stored, which seems to result in the wrong values in registers when .values is called.  Or, it would if it didn't have the wrong type when it hit ::toElem.

This only applies to the AA methods that only exist in the AssociativeArray struct in object.di

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5590



--- Comment #10 from github-bugzilla@puremagic.com 2012-03-03 00:33:01 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/44dae0ddcbdd851f8f73d4332ecfd415a2889e72
fix Issue 5590 - Regression(2.036) ICE(e2ir.c): when using .values on enum
which is associative array

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
« First   ‹ Prev
1 2