www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Issue 21] New: ICE on calling function with delegate literal

http://gdcproject.org/bugzilla/show_bug.cgi?id=21

             Bug #: 21
           Summary: ICE on calling function with delegate literal
                    containing 'new'
    Classification: Unclassified
           Product: GDC
           Version: 4.7.x
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: Normal
         Component: gdc
        AssignedTo: ibuclaw gdcproject.org
        ReportedBy: hsteoh quickfur.ath.cx


void addOp(void* delegate() impl) { }

static this() {
        addOp({ return new B(); });
}

$ gdc -I. -O3 -g3 -frelease -c -o veclist.o veclist.d
veclist.d:5: Error: undefined identifier B
cc1d: /usr/src/gcc-4.7/gcc-4.7-4.7.2/src/gcc/d/dfrontend/cast.c:1727: virtual
Expression* FuncExp::inferType(Type*, int, TemplateParameters*): Assertion
`typen->deco' failed.
cc1d: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


This error seems very dependent on the exact compilation flags; replacing
-frelease with -funittest, for example, *seems* to make it go away. But I
suspect the problem is still there; it just doesn't show up. This is the same
bug that I posted about on the forum; I was unable to reduce it last time
because I was running with -funittest, and past a certain code size the problem
becomes hidden. Furthermore, I found that separate compilation vs. bulk
compilation isn't the real issue; separate compilation with -frelease also
triggers this bug.

Also, the undefined identifier B in the original code is actually defined
(under a different name, the exact name doesn't appear to matter -- the void*
was originally a base class of B). But the problem seems to disappear upon
reduction unless I keep an undefined identifier there. So this bug is NOT
merely a problem with undefined identifiers, in the original code it's defined
but still ICE's.

During the early stages of code reduction, the above ICE was randomly
alternating with a memory corruption error. I couldn't isolate the memory
corruption, but I did manage to isolate the typen->deco ICE.

-- 
Configure issuemail: http://gdcproject.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all issue changes.
Oct 26 2012