www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5499] New: toir.c Internal error

reply d-bugmail puremagic.com writes:
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



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: -------
Jan 28 2011
next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Jan 28 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5499




Sorry, I meant just -inline.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 28 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Jan 29 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5499


dawg dawgfoto.de changed:

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



*** 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: -------
Dec 27 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5499


Trass3r <mrmocool gmx.de> changed:

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





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: -------
Jan 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5499




2012-05-03 04:36:34 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
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
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5499




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
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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: -------
May 03 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5499


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




 Added a new bug 8024 for the case that only fails to compile.
Now (dmd 2.060alpha) all test cases seems to compile (including the one in Bug 8024 ), so I close this. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 22 2012