Bug 1697 – Internal error: ..\ztc\cgcod.c 2322 with -O

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-11-28T10:52:00Z
Last change time
2014-02-24T15:32:20Z
Keywords
ice-on-valid-code
Assigned to
bugzilla
Creator
dick221z

Comments

Comment #0 by dick221z — 2007-11-28T10:52:33Z
compiling the following with the switches "-O -inline -release" gives an Internal error: ..\ztc\cgcod.c 2322 The error goes away if the -O switch is not used. The problem 1st showed up in 1.023 and is also in 1.024. Removing any line of code in this example will make the error go away. ------------------------------------- import std.utf; class foo1 { this(){} void method1( char [] name ){} void method2( int i, char [] name){} } struct foo { char [] Name; } class someclass { foo1 FooClass; foo FooStruct; private: void func() { wchar [][] theNames; FooClass.method2(-1, FooStruct.Name); FooClass.method2(-1, FooStruct.Name); foreach( Name; theNames ) { auto char [] thename = toUTF8(Name); if( thename[0..3] == "123" ) FooClass.method1(thename); if( thename[0..3] == "345" || thename[0..3] == "765" ) FooClass.method1(thename); } FooClass.method2(-1, FooStruct.Name); } public: this(){FooClass = new foo1;} }
Comment #1 by matti.niemenmaa+dbugzilla — 2007-11-28T11:18:26Z
> Removing any line of code in this example will make the error go away. Simpler version follows. Sorry, I had to act on this statement. :-) ---- void f(int n) {} void g(char[] s) {} char[][] a; class bar { int i; void func() { f(i); foreach (s; a) { if (s == s){} if (s[0..0] == "" && s[0..0]) g(s); } f(i); } } ----
Comment #2 by matti.niemenmaa+dbugzilla — 2008-01-21T02:51:29Z
Fixed in 1.026.