Bug 7847 – ICE(e2ir.c) 688 with -inline

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-06T15:07:00Z
Last change time
2013-10-06T22:20:39Z
Keywords
ice
Assigned to
nobody
Creator
timon.gehr
See also
http://d.puremagic.com/issues/show_bug.cgi?id=7851

Comments

Comment #0 by timon.gehr — 2012-04-06T15:07:28Z
DMD 2.058/DMD 2.059head --- Bar New(T,A...)(A args){return null;} class Bar{ this(Foo){ } static Bar create(){ return New!Bar(Foo(0)); } } struct Foo{ int x; this(T)(T ){void function() foo = {Bar.create();};} void bar(){Foo r=Foo("");} } --- --- Internal error: e2ir.c 688 ---
Comment #1 by timon.gehr — 2012-04-06T15:08:30Z
The -inline switch is necessary to trigger the bug.
Comment #2 by timon.gehr — 2012-04-06T15:09:26Z
The following variation crashes the compiler with a segmentation fault: Bar New(T)(Foo args){return null;} class Bar{ this(Foo){ } static Bar create(){ return New!Bar(Foo(0)); } } struct Foo{ int x; this(T)(T ){void function() foo = {Bar.create();};} void bar(){Foo r=Foo("");} }
Comment #3 by timon.gehr — 2012-04-06T15:16:41Z
The following variation causes an ICE in a different location: --- Bar New(T,A...)(A args){return null;} class Bar{ this(Foo){ } static Bar create(){ return New!Bar(Foo(0)).foo(); } Bar foo(){return this;} } struct Foo{ int x; this(T)(T ){void function() foo = {Bar.create();};} void bar(){Foo r=Foo("");} } --- --- Internal error: e2ir.c 3500 ---
Comment #4 by robert — 2012-05-02T08:31:03Z
Please report another bug for the ICE in a different location. See also bug #7851.
Comment #5 by bugzilla — 2013-10-06T22:20:39Z
All the examples compile successfully with 2.064 head.