Bug 13599 – [D1] backend/cod1.c ICE with -inline

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2014-10-10T15:11:00Z
Last change time
2014-10-13T04:55:55Z
Keywords
industry
Assigned to
nobody
Creator
public

Comments

Comment #0 by public — 2014-10-10T15:11:42Z
Reduced test case: const C = 1; struct E ( ubyte G ) { } alias E!(C) I; struct J { } class L { struct M ( N... ) { union { N P; } Q R ( Q ) () { foreach ( U ; P ) return U; assert(0); } } class X { bool delegate ( ) AB; } class BB ( M, I, CB, DB ) : X { void FB ( ) { this.AB = &this.outer.IB!(I, CB); } } bool IB ( I, CB ) ( ) { auto KB = &(cast(CB)this).MB!(I); return false; } alias M!(I) OB; BB!(OB, I, typeof(this), J) QB; void MB (RB) ( ) { auto SB = cast(OB*) null; SB.R!(RB); } } $ dmd1 -inline ./result.d Internal error: backend/cod1.c 1708
Comment #1 by bugzilla — 2014-10-12T20:42:16Z
This one works on D2.
Comment #2 by bugzilla — 2014-10-12T21:06:56Z
Reduced test case: struct E { } struct M ( N... ) { struct { N P; } E R() { foreach ( U ; P ) return U; assert(0); } } void MB( ) { auto SB = cast(M!(E)*) null; SB.R(); }
Comment #3 by bugzilla — 2014-10-12T22:03:55Z
Workaround, in case it is blocking anyone: (In reply to Walter Bright from comment #2) > E R() > { > foreach ( U ; P ) > return U; > assert(0); return E(); // add this line > } > }
Comment #4 by github-bugzilla — 2014-10-13T04:40:34Z
Comment #5 by github-bugzilla — 2014-10-13T04:50:47Z
Comment #6 by bugzilla — 2014-10-13T04:55:55Z
An even smaller test case: struct E { } E R() { { return E.init; } assert(0); } void MB( ) { R(); }