Thread overview
[Issue 15206] ICE on optimized build, tym = x1d Internal error: backend\cgxmm.c 547
Oct 15, 2015
Vladimir Panteleev
October 15, 2015
https://issues.dlang.org/show_bug.cgi?id=15206

Vladimir Panteleev <thecybershadow@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow@gmail.com

--- Comment #1 from Vladimir Panteleev <thecybershadow@gmail.com> ---
A reproducible test case is needed, reduced or not.

--
January 09
https://issues.dlang.org/show_bug.cgi?id=15206

briancschott@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code, industry
                 CC|                            |briancschott@gmail.com
                 OS|Windows                     |All

--- Comment #2 from briancschott@gmail.com ---
Here's a test case minimized from a failed build of some data processing code at EMSI. This is partially a 2.078.0 regression, but I wasn't sure about filing a new issue since it seems to be a duplicate of this bug.

-----------------------------

void main()
{
}

struct Line
{
    double slope;
    double intercept;
}

Line nLineProjection(double[] historicData)
{
    Line projLine;
    projLine.intercept = historicData[$-1] + projLine.slope;
    return projLine;
}

-----------------------------

$ dmd -O test.d
tym = x1d
Internal error: dmd/backend/cgxmm.c 684
$ dmd --version
DMD64 D Compiler v2.078.0
Copyright (c) 1999-2017 by The D Language Foundation written by Walter Bright

--
January 09
https://issues.dlang.org/show_bug.cgi?id=15206

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx
           Severity|normal                      |critical

--- Comment #3 from hsteoh@quickfur.ath.cx ---
All ICEs should be critical.

--
January 10
https://issues.dlang.org/show_bug.cgi?id=15206

--- Comment #4 from briancschott@gmail.com ---
It seems that the problem is in the allocreg function called from loaddata.

I added some debugging printfs before and after calls to `allocreg` and I see the following:

before: tym = 0x1d, forregs = 0x020000, reg = BP|SI|DI|R10|R12|R15|XMM0|XMM1|XMM3|XMM4|XMM5|XMM6|XMM7|PSW|NOREG|RMload

after: tym = 0x1d, forregs = 0x020000, reg = AX|SP

It seems that the `forregs` variable (The `pretregs` parameter to allocreg) is not getting modified properly. It still has the value 0x20000, which matches the XMMREGS mask even though `allocreg` has correctly removed all the XMM registers from the list of valid registers in the `reg` variable. Because this `forregs` variable is not masked out by XMMREGS, there is a call to `xmmload` even though `xmmload` doesn't support `tym` values of 0x1d.

--
January 12
https://issues.dlang.org/show_bug.cgi?id=15206

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |SIMD
                 CC|                            |bugzilla@digitalmars.com

--