December 29, 2010 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 --- Comment #28 from Haruki Shigemori <rayerd.wiz@gmail.com> 2010-12-29 08:39:15 PST --- (In reply to comment #27) > A simpler command line is this: > /dmd/src/phobos/std> dmd -c -unittest conv.d stdio.d > The unittest which it's failing in, is in stdio.d, line 1630: > > unittest > { > float f; > if (false) readf("%s", &f); > } > Which just shows how nasty this bug is. This is a progress report. failed: /dmd/src/phobos/std dmd -c -unittest conv.d stdio.d succeeded: /dmd/src/phobos/std dmd -c -unittest stdio.d conv.d -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
December 29, 2010 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 --- Comment #29 from Haruki Shigemori <rayerd.wiz@gmail.com> 2010-12-29 10:14:31 PST --- A simpler sample is this: // module a import b; void main() { foo!int(0); } // module b void foo(T)(T p) { void inner(U)() { auto p2 = p; } inner!int(); } C:\Users\haru\Desktop\c>dmd b a b.d(1): Error: function b.foo!(int).foo compiler error, parameter 'p', bugzilla 2962? assert glue.c(729) 0 <--------------------------------- HALT However, the following result is success. C:\Users\haru\Desktop\c>dmd a b Max # of fixups = 8 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 30, 2011 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 Rainer Schuetze <r.sagitario@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |r.sagitario@gmx.de --- Comment #30 from Rainer Schuetze <r.sagitario@gmx.de> 2011-01-30 08:07:38 PST --- I've also hit this issue today after updating to the latest dmd and runtime from github. As there is no hint where the problem is in my project, I took a look at the last test case, and figured out a few things: - the template instantiation for foo is added to module a, but the instantiation of inner is added to module b. - the error is triggered because the code for the inner function is generated before the code for the outer function. Hence the reliance on the order of modules on the command line. - that made me think, that it might be ok to just skip the test, but the following code shows, that it does not work because the inner function needs the stack offset which is only calculated when the outer function is generated: // module b T foo(T)(T p, int q) { T inner(U)() { return p; } return inner!int(); } // module a import b; void main() { assert(foo!int(5, 2) == 5); } fails for "dmd b.a b.d", but not for "dmd a.d b.d". Is there a good reason why the inner function is generated into a different module than the outer function? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 06, 2011 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 --- Comment #31 from Rainer Schuetze <r.sagitario@gmx.de> 2011-02-06 12:22:16 PST --- Investigating this a little further, I noticed that when compiling "dmd b a" the problem seems to be that inner!int is *parsed* before the invocation of the outer foo, which causes a TemplateInstance to be created. This later causes the code generation of inner to come first, making the compiler bail out, because the reference to the parameter of the outer function is not known yet. As a workaround it seems to work if you put a reference to foo!int where the parser sees it before inner!int, for example into another file c.d: module c; static if(__traits(compiles,foo!int))){} and the compile it with "dmd c b a". -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 18, 2011 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 Bernard Helyer <blood.of.life@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blood.of.life@gmail.com --- Comment #32 from Bernard Helyer <blood.of.life@gmail.com> 2011-02-18 03:45:08 PST --- Ouch. Hit this when compiling SDC ( https://github.com/bhelyer/SDC ) with 2.052. I'm stuck on 2.051 for the time being. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 23, 2011 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 Andriy <andrden@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrden@gmail.com --- Comment #33 from Andriy <andrden@gmail.com> 2011-05-23 02:35:44 PDT --- dmd v2.052, Ubuntu, quite short example of this bug: $ cat main.d import std.stdio; void main(){} $ cat utils.d import std.json; auto val = &parseJSON!string; $ dmd main.d utils.d /usr/include/d/dmd/phobos/std/conv.d(1301): Error: function std.conv.parse!(real,string).parse compiler error, parameter 'p', bugzilla 2962? dmd: glue.c:734: virtual void FuncDeclaration::toObjFile(int): Assertion `0' failed. Aborted (core dumped) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 23, 2011 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 --- Comment #34 from Don <clugdbug@yahoo.com.au> 2011-05-23 04:20:16 PDT --- (In reply to comment #33) > dmd v2.052, Ubuntu, quite short example of this bug: <snip> No, that's a long example -- it imports from Phobos. Test cases for compiler bugs which import from Phobos are not completely reduced. The examples in comments 20 and 29 are minimal test cases. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 03, 2012 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich@gmail.com --- Comment #35 from Don <clugdbug@yahoo.com.au> 2012-02-03 02:25:33 PST --- *** Issue 7323 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 22, 2012 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 dawg@dawgfoto.de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dawg@dawgfoto.de --- Comment #36 from dawg@dawgfoto.de 2012-03-22 11:11:55 PDT --- cat > a.d << CODE import b; alias foo!() fooi; CODE cat > b.d << CODE void foo()(int p) { int inner()() { return p; } alias inner!() finner; } CODE dmd -c b a -------- Slightly more reduced test case. There are two things that should get fixed. - We push template instances into the wrong object/module. The module a template instance is attached to is found by following the importedFrom chain. The head of the chain should be the template declaration module not the instantiation module. By doing so we guarantee that all instances remain ordered and are bundled with their dependencies. - VarDeclaration::toSymbol creates csym lazily. I don't see any reason why this shouldn't apply to parameters as well, e.g. replacing the 'p' parameter with a local variable fixes the bug. So we should just call v->toSymbol() and remove the assertion. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 23, 2012 [Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bugzilla@kyllingen.net | http://d.puremagic.com/issues/show_bug.cgi?id=2962 --- Comment #37 from github-bugzilla@puremagic.com 2012-03-22 22:41:57 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/47f5929059811b4b0d2d35c7833cabd7db490c8e workaround Bug 2962 - ICE with nested template functions - there is no need to templatize bailOut https://github.com/D-Programming-Language/phobos/commit/717bd999ba0427d5bd884cded218355f735c5674 Merge pull request #505 from dawgfoto/workaround2962 workaround Bug 2962 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation