www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6228] New: ICE(e2ir.c:1323, 2.053) on {auto x = (*ptr) ^^ y} with const integer types

reply d-bugmail puremagic.com writes:
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



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: -------
Jun 29 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6228


yebblies <yebblies gmail.com> changed:

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



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: -------
Jun 29 2011
prev sibling parent d-bugmail puremagic.com writes:
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



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: -------
Aug 05 2011