Thread overview
[Issue 6228] New: ICE(e2ir.c:1323, 2.053) on {auto x = (*ptr) ^^ y} with const integer types
Jun 30, 2011
Rob Jacques
Jun 30, 2011
yebblies
[Issue 6228] Regression(2.053) ICE(e2ir.c) on {auto x = (*ptr) ^^ y} with const integer types
Aug 05, 2011
Walter Bright
June 30, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6228

           Summary: ICE(e2ir.c:1323, 2.053) on {auto x = (*ptr) ^^ y} with
                    const integer types
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: sandford@jhu.edu


--- Comment #0 from Rob Jacques <sandford@jhu.edu> 2011-06-29 18:17:01 PDT ---
This ICE is a regression between DMD 2.052 and DMD 2.053. It occurs when a point to a const integer type is raised to the power of const integer type. i.e.

void main(string[] args) {
const(int)* ptr;
const(int)  temp;
auto x = (*ptr) ^^ temp;
}

which results in the error:

const(int) 02871BB0
const(int) 02871BB0
ty = 19, tym = 4a
Internal error: e2ir.c 1323

this effects other integer types at the same line location but with different ty and tym values. The ty and tym values seem to be specific to ptr's type. The ICE doesn't occur for reals or if temp is not a const integer. Other rearrangements of the code, such as

    auto x = __temp ^^ __temp;
    auto x = __temp ^^ (*__ptr);
    auto x = (*__ptr) ^^ (*__ptr);

do not ICE.

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


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |yebblies@gmail.com


--- Comment #1 from yebblies <yebblies@gmail.com> 2011-06-30 14:07:07 EST ---
The bug is that a ^^ b can be incorrectly const folded when b is 0 and a is integral but not an integral literal.


void main() {
    int* ptr;
    auto x = (*ptr) ^^ 0;
}

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

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


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-08-05 11:24:20 PDT ---
https://github.com/D-Programming-Language/dmd/commit/1032bd1458da31f1fcde73fc5ba65c5ec76b9872

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