www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11201] New: ICE: -inline stops compilation

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11201

           Summary: ICE: -inline stops compilation
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: daniel350 bigpond.com


--- Comment #0 from daniel350 bigpond.com 2013-10-08 22:37:35 PDT ---
struct Foo {
    float a, b;

    Foo opUnary(string op)() const { return this; }
    Foo opBinary(string op)(float) { return this; }
}

auto f1(T)(T a) { return 1; }
auto f2(T)(T a) { return a * f1(a); }

void main() {}

unittest {
    auto a = Foo(0, 1);

    assert(f2(-a) == a);
}


I've reduce the code as much I thought possible, removal of anything else stops
the ICE occuring.
When compiling the above code, with the following command line arguments:

`dmd -unittest -inline test.d`

Displays

`Internal error: backend/symbol.c 1036`

Confirmed with Arch Linux and OSX.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 08 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11201



--- Comment #1 from daniel350 bigpond.com 2013-10-08 22:39:04 PDT ---
Confirmed on Git HEAD (511b24a457)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 08 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11201



--- Comment #2 from daniel350 bigpond.com 2013-10-08 22:43:06 PDT ---
Further reduced:

struct Foo {
    float a, b;

    Foo opUnary(string op)() const { return this; }
}

auto f1(T)(T a) { return a; }
auto f2(T)(T a) { return f1(a); }

void main() {}

unittest {
    auto a = Foo(0, 1);

    assert(f2(-a) == a);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 08 2013