Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla

Bug 47

Summary: ICE when mixing in functions containing inline asm
Product: GDC Reporter: jerro.public
Component: gdcAssignee: Iain Buclaw <ibuclaw>
Status: RESOLVED FIXED    
Severity: normal    
Priority: ---    
Version: 4.8.x   
Hardware: x86_64   
OS: Linux   

Description jerro.public 2013-03-20 18:54:37 CET
A test case:

template Foo()
{
    void bar()
    {
        asm { "nop"; }
    }
}

mixin Foo!();

When building this with GDC 7907920a3ef0a26594c934, using gcc 4.8.0 RC1, I get:

@debian:~/tmp$ gdc  tmp.d -c
cc1d: internal compiler error: Segmentation fault
0x8cac9f crash_signal
        ../../gcc-4.8.0-RC-20130316/gcc/toplev.c:332
0x635535 ExtAsmStatement::syntaxCopy()
        ../../gcc-4.8.0-RC-20130316/gcc/d/d-asmstmt.cc:74
0x5e473a CompoundStatement::syntaxCopy()
        ../../gcc-4.8.0-RC-20130316/gcc/d/dfrontend/statement.c:510
0x5e473a CompoundStatement::syntaxCopy()
        ../../gcc-4.8.0-RC-20130316/gcc/d/dfrontend/statement.c:510
0x58b4f9 FuncDeclaration::syntaxCopy(Dsymbol*)
        ../../gcc-4.8.0-RC-20130316/gcc/d/dfrontend/func.c:107
0x567eb2 Dsymbol::arraySyntaxCopy(ArrayBase<Dsymbol>*)
        ../../gcc-4.8.0-RC-20130316/gcc/d/dfrontend/dsymbol.c:766
0x5fb90f TemplateMixin::semantic(Scope*)
        ../../gcc-4.8.0-RC-20130316/gcc/d/dfrontend/template.c:6580
0x5fb90f TemplateMixin::semantic(Scope*)
        ../../gcc-4.8.0-RC-20130316/gcc/d/dfrontend/template.c:6391
0x5c6d17 Module::semantic()
        ../../gcc-4.8.0-RC-20130316/gcc/d/dfrontend/module.c:714
0x60ca8b d_parse_file()
        ../../gcc-4.8.0-RC-20130316/gcc/d/d-lang.cc:960
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 2 jerro.public 2013-03-20 19:23:41 CET
(In reply to comment #1)
> https://github.com/D-Programming-GDC/GDC/commit/777f40c8b01e1efb21e5569cc527c74bd1074b98

Well that was fast :)
Comment 3 Iain Buclaw 2013-03-20 19:27:38 CET
Total time spent on bug:  Probably 120 seconds, idk. I step aside for a moment to serve myself dinner.