Bug 2431 – Internal error: ../ztc/cgcod.c 1031 when using -O
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2008-10-25T21:58:00Z
Last change time
2014-03-01T00:36:59Z
Keywords
ice-on-valid-code
Assigned to
bugzilla
Creator
moritzwarning
Comments
Comment #0 by moritzwarning — 2008-10-25T21:58:20Z
The following code triggers this error when compiled with -O:
void trigger(char[] txt)
{
txt[0] = 'x';
scope(exit)
{
txt[0] = 'x';
}
return;
}
Removing return or moving scope(exit) to the top of the body fixes the problem.
Tested on Debian GNU Linux.