www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17215] New: ICE(cgcod.c:findreg) with SIMD and -O -inline

https://issues.dlang.org/show_bug.cgi?id=17215

          Issue ID: 17215
           Summary: ICE(cgcod.c:findreg) with SIMD and -O -inline
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

cat > bug.d << CODE
alias vec = __vector(int[4]);

vec op(vec a)
{
    return a;
}

vec binop(vec a)
{
    return op(a);
}
CODE
dmd -c -O -inline bug
----
Internal error: backend/cgcod.c 1659 [¹]
----

Ends up calling findreg with an empty register mask. Seems like sth. in
loaddata or so doesn't properly handle xmm registers.


Callstack:
----
0  in findreg of backend/cgcod.c:1659
1  in fixresult of backend/cod1.c:1802
2  in loaddata of backend/cod1.c:4769
3  in codelem of backend/cgcod.c:2669
4  in scodelem of backend/cgcod.c:2740
5  in cdeq of backend/cod4.c:646
6  in codelem of backend/cgcod.c:2619
7  in cdcomma of backend/cod2.c:2195
8  in codelem of backend/cgcod.c:2619
9  in cdcomma of backend/cod2.c:2194
10 in codelem of backend/cgcod.c:2619
----

[¹]:
https://github.com/dlang/dmd/blob/65f2dfdddae822cf6bb483e82eac32839e142a72/src/backend/cgcod.c#L1659

--
Feb 20