digitalmars.D.bugs - [Issue 7900] New: CTFE Internal error with -inline and associative arrays
- d-bugmail puremagic.com (58/58) Apr 13 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7900
- d-bugmail puremagic.com (11/11) Apr 13 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7900
- d-bugmail puremagic.com (12/13) Apr 16 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7900
- d-bugmail puremagic.com (17/17) Apr 21 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7900
- d-bugmail puremagic.com (13/13) May 04 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7900
- d-bugmail puremagic.com (9/9) Aug 02 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7900
- d-bugmail puremagic.com (17/17) Nov 06 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7900
- d-bugmail puremagic.com (13/13) Nov 30 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7900
http://d.puremagic.com/issues/show_bug.cgi?id=7900 Summary: CTFE Internal error with -inline and associative arrays Product: D Version: D2 Platform: x86_64 OS/Version: Linux Status: NEW Severity: major Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: brian-schott cox.net --- Comment #0 from brian-schott cox.net 2012-04-13 20:38:32 PDT --- Reduced test case created with Dustmite and a bit of hand-editing: -------------------------------- import std.range; class Trie(K, V) { void add(K key, V val) { Trie!(K,V) current = this; foreach(keyPart; key) { current.children[keyPart] = new Trie!(K, V); } } Trie!(K,V)[ElementType!K] children; } string fun(string[] args ...) { auto t = new Trie!(string, string); t.add(args[0], ""); foreach(v; t.children) if (v.children.length) {} return ""; } void main() { mixin(fun("=", "TokenType.assign")); } -------------------------------- testcase.d(21): Error: CTFE internal error: illegal value ��D.children dmd: interpret.c:6678: void VarDeclaration::setValue(Expression*): Assertion `isCtfeValueValid(newval)' failed. Aborted ------------------------------- No, that garbage in the error message is not a copy-paste error. It's different each time I try to build, which leads me to suspect that something in the compiler was uninitialized. Possibly related: changing line 21 to foreach(v; t.children.values) results in this error: dmd: interpret.c:5527: TypeAArray* toBuiltinAAType(Type*): Assertion `t->ty == Tstruct' failed. Aborted -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 13 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7900 brian-schott cox.net changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |CTFE, ice --- Comment #1 from brian-schott cox.net 2012-04-13 20:42:48 PDT --- I just realized that the dropdown options are out-of-date. I have reproduced this on 2.059 and 2.058. The compile only fails with the -inline switch. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 13 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7900 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug yahoo.com.au --- Comment #2 from Don <clugdbug yahoo.com.au> 2012-04-16 03:42:59 PDT --- (In reply to comment #1)I just realized that the dropdown options are out-of-date.They are not out of date. They contain a lot of obsolete tags. Nobody should use anything other than D1, D2, D1&D2. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 16 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7900 SomeDude <lovelydear mailmetrash.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lovelydear mailmetrash.com Platform|x86_64 |All OS/Version|Linux |All --- Comment #3 from SomeDude <lovelydear mailmetrash.com> 2012-04-21 11:31:15 PDT --- Same issue on Win32 2.059. The windows version gives the file/line of the assertion, though. PS E:\DigitalMars\dmd2\samples> rdmd -inline bug.d bug.d(21): Error: CTFE internal error: illegal value P▄S.children Assertion failure: 'isCtfeValueValid(newval)' on line 6678 in file 'interpret.c' -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 21 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7900 --- Comment #4 from brian-schott cox.net 2012-05-04 18:37:02 PDT --- Using DMD from git (b488853f4d3617945851d5d0a2ac20ccb7dab631), the error message now shows: tmp.d(21): Error: CTFE internal error: illegal value TOK232.children dmd: interpret.c:6884: void VarDeclaration::setValue(Expression*): Assertion `isCtfeValueValid(newval)' failed. Aborted The corrupted output is now gone, so that's a good thing. Test case still compiles without -inline and fails when it is present. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 04 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7900 --- Comment #5 from brian-schott cox.net 2012-08-02 14:09:17 PDT --- 2.60 error: dmd: expression.c:1276: void expToCBuffer(OutBuffer*, HdrGenState*, Expression*, PREC): Assertion `precedence[e->op] != PREC_zero' failed. Aborted -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 02 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7900 --- Comment #6 from Don <clugdbug yahoo.com.au> 2012-11-06 08:41:27 PST --- Reduced test case: class Trie { Trie[dchar] children; } int bug7900() { Trie t = new Trie; t.children['='] = new Trie; foreach(v; t.children) if (v.children.length) {} return 1; } static assert(bug7900()); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 06 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7900 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #7 from Don <clugdbug yahoo.com.au> 2012-11-30 01:05:12 PST --- This was fixed as side effect of a commit which eliminates all CTFE inlining bugs: https://github.com/D-Programming-Language/dmd/commit/4d9d227cca763985583bf05958ac1f45eef36eda -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 30 2012