Bug 1332 – Internal error: ../ztc/cod4.c 357

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2007-07-11T08:47:00Z
Last change time
2014-02-16T15:22:08Z
Keywords
ice-on-valid-code
Assigned to
bugzilla
Creator
fvbommel

Comments

Comment #0 by fvbommel — 2007-07-11T08:47:13Z
===== urxae@urxae:~/tmp$ dmd test.d -c -g urxae@urxae:~/tmp$ dmd test.d -c -gc urxae@urxae:~/tmp$ dmd test.d -c -O urxae@urxae:~/tmp$ dmd test.d -c -g -O Internal error: ../ztc/cod4.c 357 urxae@urxae:~/tmp$ dmd test.d -c -gc -O Internal error: ../ztc/cod4.c 357 ==== As you can see, both (-g or -gc) and -O must be specified for the error to occur. The source: --- void recurse(inout int i) { int j = i; recurse(j); } --- The argument must be inout, and the argument to the recursive invocation must depend on the value of the original argument. If 'j' is initialized to '0', 'i*0' or similar it compiles fine. If it's initialized to 'i', 'i+1', etc. it errors out. If the parameter type is a struct (or a pointer to one) and the recursive invocation uses a value derived from a field as parameter it also errors out. (e.g. 'Node* n'/'n.next' or 'Node n'/'*n.next' as formal parameter/argument pair)
Comment #1 by bugzilla — 2007-07-30T15:50:49Z
Fixed DMD 1.019 and 2.003