Bug 15210 – [REG2.064][ICE] (glue.c at 1489) with tuples and AAs

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-16T16:18:00Z
Last change time
2015-10-23T01:56:51Z
Keywords
ice, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2015-10-16T16:18:33Z
DMD v.2.069.0-b2: Compile with -inline: void main() { import std.typecons: Tuple; import std.bigInt: BigInt; alias Foo = Tuple!(BigInt); static Foo[BigInt] cache; auto x = Foo(BigInt(0)); BigInt[] arr; foreach (y; arr) cache[y] = x; } Assertion failure: '0' on line 1489 in file 'glue.c' Related to Issue 10632?
Comment #1 by dlang-bugzilla — 2015-10-16T23:46:23Z
This seems to be a regression. Introduced in https://github.com/D-Programming-Language/dmd/pull/2653
Comment #2 by k.hara.pg — 2015-10-20T15:12:33Z
Reduced test case: struct BigInt {} alias AliasSeq(T...) = T; template Tuple(Types) { struct Tuple { Types expand; alias field = expand; } } void main() { alias Foo = Tuple!BigInt; Foo[BigInt] cache; auto x = Foo(); BigInt[] arr; foreach (y; arr) cache[y] = x; }
Comment #3 by k.hara.pg — 2015-10-20T15:32:21Z
(In reply to Kenji Hara from comment #2) > Reduced test case: Sorry I was wrong, correct version is: struct BigInt {} template Tuple(Types...) { struct Tuple { Types field; void opAssign(R)(R rhs) { field = rhs.field; } } } void main() { alias Foo = Tuple!BigInt; Foo[BigInt] cache; auto x = Foo(); cache[BigInt()] = x; }
Comment #4 by k.hara.pg — 2015-10-20T16:50:48Z
Comment #5 by k.hara.pg — 2015-10-21T08:40:00Z
Comment #6 by github-bugzilla — 2015-10-21T23:05:12Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/34f10ecaea2a8a3d9dbb20d089bf63217e00ff92 fix Issue 15210 - [ICE] (glue.c at 1489) with tuples and AAs https://github.com/D-Programming-Language/dmd/commit/0a72d643af818c26b6630b3d93b94b24ed21f2d7 Merge pull request #5216 from 9rnsr/fix15210 [REG2.064] Issue 15210 - [ICE] (glue.c at 1489) with tuples and AAs
Comment #7 by github-bugzilla — 2015-10-23T01:56:51Z