Bug 6228 – Regression(2.053) ICE(e2ir.c) on {auto x = (*ptr) ^^ y} with const integer types

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-06-29T18:17:00Z
Last change time
2011-08-05T11:24:20Z
Keywords
ice-on-valid-code, patch
Assigned to
nobody
Creator
sandford

Comments

Comment #0 by sandford — 2011-06-29T18:17:01Z
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.
Comment #1 by yebblies — 2011-06-29T21:07:07Z
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
Comment #2 by bugzilla — 2011-08-05T11:24:20Z