Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 254 - [ICE] (thunk_adjust) cgraphunit.c:1535: Segmentation fault
Summary: [ICE] (thunk_adjust) cgraphunit.c:1535: Segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: development
Hardware: All All
: --- normal
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2017-03-04 14:51 CET by Iain Buclaw
Modified: 2017-03-04 22:09 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Iain Buclaw 2017-03-04 14:51:48 CET
Found when reducing bug 253

---
import impA;

interface A
{
    void foo(string[string]);
}

class C : B, A
{
}
---
module impA;

class B
{
    void foo(string[string])
    {
        if (to) return;
    }

}
---


$ gdc test.d 
test.d:8:1: error: class test.C interface function 'void foo(string[string])' is not implemented
 class C : B, A
 ^
imp.d:7:13: error: undefined identifier 'to'
         if (to) return;
             ^
test.d: In function ‘_DT16_D3imp1B3fooMFHAyaAyaZv’:
test.d:1:8: internal compiler error: Segmentation fault
 import imp;
        ^
0xc16c96 crash_signal
	../../dev/gcc/toplev.c:333
0x90c4e5 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*)
	../../dev/gcc/tree.h:3177
0x90c4e5 fold_build_pointer_plus_hwi_loc(unsigned int, tree_node*, long)
	../../dev/gcc/fold-const.c:14373
0x7ea910 thunk_adjust(gimple_stmt_iterator*, tree_node*, bool, long, tree_node*)
	../../dev/gcc/cgraphunit.c:1535
0x7eb292 cgraph_node::expand_thunk(bool, bool)
	../../dev/gcc/cgraphunit.c:1799
0x707adf finish_thunk
	../../dev/gcc/d/d-decls.cc:646
0x707adf make_thunk(FuncDeclaration*, int)
	../../dev/gcc/d/d-decls.cc:712
0x753437 TypeInfoVisitor::layout_base_vtable(ClassDeclaration*, ClassDeclaration*, unsigned long)
	../../dev/gcc/d/typeinfo.cc:189
0x753437 TypeInfoVisitor::visit(TypeInfoClassDeclaration*)
	../../dev/gcc/d/typeinfo.cc:624
0x753437 TypeInfoClassDeclaration::accept(Visitor*)
	../../dev/gcc/d/dfrontend/declaration.h:343
0x753437 layout_classinfo(ClassDeclaration*)
	../../dev/gcc/d/typeinfo.cc:846
0x71c790 ClassDeclaration::toObjFile()
	../../dev/gcc/d/d-objfile.cc:296
0x71f9dd Module::genobjfile(bool)
	../../dev/gcc/d/d-objfile.cc:1133
0x6feb7b d_parse_file()
	../../dev/gcc/d/d-lang.cc:1351
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


At a glance of the backtrace, seems like a rather lack of error handling.
Comment 1 Iain Buclaw 2017-03-04 16:45:37 CET
https://github.com/D-Programming-GDC/GDC/pull/409