[Issue 3006] ICE(e2ir.c, tocsym.c) template module using array operation
https://issues.dlang.org/show_bug.cgi?id=3006 Walter Bright changed: What|Removed |Added Version|1.042 |D1 --
[Issue 3006] ICE(e2ir.c, tocsym.c) template module using array operation
http://d.puremagic.com/issues/show_bug.cgi?id=3006 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #4 from Walter Bright 2009-10-13 13:45:08 PDT --- Fixed dmd 1.049 and 2.034 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3006] ICE(e2ir.c, tocsym.c) template module using array operation
http://d.puremagic.com/issues/show_bug.cgi?id=3006 HOSOKAWA Kenchi changed: What|Removed |Added CC||hs...@inter7.jp --- Comment #3 from HOSOKAWA Kenchi 2009-08-20 13:06:22 PDT --- (In reply to comment #2) Much thanks for your analysis, Don. I met almost the same error today. // bugx.d void foo() { real[3] s, a, b; s[] = a[] + b[]; } // bug.d void bar() { foo; // p2 Internal error: e2ir.c 632 @ DMD 2.031 } This ICE occurs without template in this case. Compiling bugx.d cause no error, calling foo from OTHER module cause ICE. Besides, compiler switchs affect: ( -release && !-unittest ) cause this ICE. Anyway the root cause is obviously the same. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3006] ICE(e2ir.c, tocsym.c) template module using array operation
http://d.puremagic.com/issues/show_bug.cgi?id=3006 Don changed: What|Removed |Added Keywords||patch --- Comment #2 from Don 2009-06-03 16:07:40 PDT --- Root cause: semantic3 never gets run on the function which is created, if it's compiled in a module which doesn't instantiate the template it's in. To fix this, we can run its semantic3 immediately, since we're already in semantic3 for this module. BTW: It also seems to me that the back-end should have assert(FuncDeclaration->semanticRun==4) before running toObj(), to ensure semantic3 has been run (it would be a better place to ICE). BTW: FuncDeclaration::toObj() is declared but never defined or used. PATCH: Add this code to arrayop.c, BinExp::arrayOp, line 393. sc->linkage = LINKc; fd->semantic(sc); + fd->semantic2(sc); + fd->semantic3(sc); sc->pop(); // TEST CASE 1. Compilation order is important. dmd bugx.d bug.d -- bug.d -- import bugx; void main(){ foo!(long)(); } -- bugx.d -- void foo(T)() { long[] a; a[] = -a[]; } // TEST CASE 2: replace bugx with: void foo(T)() { T[] a; a[] = -a[]; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3006] ICE(e2ir.c, tocsym.c) template module using array operation
http://d.puremagic.com/issues/show_bug.cgi?id=3006 Don changed: What|Removed |Added Summary|ICE(e2ir.c) template module |ICE(e2ir.c, tocsym.c) |using array operation |template module using array ||operation --- Comment #1 from Don 2009-05-19 01:18:11 PDT --- Fails also on D1 with a bizarre error message. Where the heck did variable 'p' come from? dmd bug2.d bug.d (order is important). Error: variable p forward referenced Error: variable p forward referenced linkage = 0 Assertion failure: '0' on line 262 in file 'tocsym.c' abnormal program termination === bug.d -- import bug2; void main() { foo!(long)(); } -- bug2.d -- void foo(T)() { long[] a; a[] = -a[]; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---