Jump to page: 1 2
Thread overview
[Issue 5499] New: toir.c Internal error
[Issue 5499] ICE(toir.c): delegate as alias template parameter, only with -release -inline
Jan 28, 2011
Don
[Issue 5499] ICE(toir.c): delegate as alias template parameter, only with -inline
Jan 29, 2011
Don
Dec 27, 2011
dawg@dawgfoto.de
Jan 20, 2012
Trass3r
May 03, 2012
Leandro Lucarella
May 03, 2012
Leandro Lucarella
May 03, 2012
Leandro Lucarella
May 03, 2012
Leandro Lucarella
January 28, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5499

           Summary: toir.c Internal error
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2011-01-28 14:06:07 PST ---
void foo(alias f)() {
    foo!f();
}
void bar() {
    foo!({})();
}
void main() {
    void spam() {
        bar();
    }
}


Compiling it in -release with dmd 2.051 gives:
Internal error: toir.c 190

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 28, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5499


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |ice-on-valid-code
                 CC|                            |clugdbug@yahoo.com.au
            Summary|toir.c Internal error       |ICE(toir.c): delegate as
                   |                            |alias template parameter,
                   |                            |only with -release -inline


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2011-01-28 14:30:11 PST ---
I couldn't reproduce this until I used -inline as well as -release.

Looks similar to bug 4504, but this test case is shorter, and 4504 doesn't require -release.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 28, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5499



--- Comment #2 from bearophile_hugs@eml.cc 2011-01-28 14:32:57 PST ---
Sorry, I meant just -inline.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 29, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5499


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE(toir.c): delegate as    |ICE(toir.c): delegate as
                   |alias template parameter,   |alias template parameter,
                   |only with -release -inline  |only with -inline


--- Comment #3 from Don <clugdbug@yahoo.com.au> 2011-01-29 05:52:33 PST ---
Here's an interesting variation. Without -inline, it compiles correctly, but if
-inline is set, it generates:
test0.d(2): Error: function test0.bar.foo!(delegate void(){}).foo is a nested
function and cannot be accessed from main
=====
void foo(alias f)(int x) {
    if (x>1)
       foo!f(x-1);
}

void bar() {
    foo!({})(2);
}

void main() {
    bar();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 27, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5499


dawg@dawgfoto.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #4 from dawg@dawgfoto.de 2011-12-27 11:37:16 PST ---
*** Issue 7164 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: -------
January 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5499


Trass3r <mrmocool@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool@gmx.de


--- Comment #5 from Trass3r <mrmocool@gmx.de> 2012-01-20 05:06:08 PST ---
(In reply to comment #3)

Same as http://d.puremagic.com/issues/show_bug.cgi?id=4841 ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5499


Leandro Lucarella <leandro.lucarella@sociomantic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |leandro.lucarella@sociomant
                   |                            |ic.com


--- Comment #6 from Leandro Lucarella <leandro.lucarella@sociomantic.com> 2012-05-03 04:36:04 PDT ---
Another simpler test case, or is this another bug?

---
void foo(alias f)() {
    f();
}

void bar() {
        foo!({})();
}

void main() {
        bar();
}
---

m1.d(1): Error: function m1.bar.foo!(delegate void()
{
}
).foo is a nested function and cannot be accessed from main

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5499



--- Comment #7 from Leandro Lucarella <leandro.lucarella@sociomantic.com> 2012-05-03 04:36:34 PDT ---
(In reply to comment #6)
> Another simpler test case, or is this another bug?
> 
> ---
> void foo(alias f)() {
>     f();
> }
> 
> void bar() {
>         foo!({})();
> }
> 
> void main() {
>         bar();
> }
> ---
> 
> m1.d(1): Error: function m1.bar.foo!(delegate void()
> {
> }
> ).foo is a nested function and cannot be accessed from main

Maybe is another bug because this is D1 only.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5499



--- Comment #8 from Leandro Lucarella <leandro.lucarella@sociomantic.com> 2012-05-03 04:37:47 PDT ---
But the testcases provided here compiles in current dmd2!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5499


Leandro Lucarella <leandro.lucarella@sociomantic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |http://d.puremagic.com/issu
                   |                            |es/show_bug.cgi?id=8024


--- Comment #9 from Leandro Lucarella <leandro.lucarella@sociomantic.com> 2012-05-03 05:08:59 PDT ---
Added a new bug 8024 for the case that only fails to compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
« First   ‹ Prev
1 2