Skip to content

Commit

Permalink
Merge pull request #6275 from WalterBright/fix13927
Browse files Browse the repository at this point in the history
fix Issue 13927 - optimizer hangs in optelem with SIMD initialization
  • Loading branch information
MartinNowak committed Nov 24, 2016
1 parent 2df3901 commit c3a3200
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/cgelem.c
Expand Up @@ -1124,7 +1124,8 @@ STATIC elem * elmin(elem *e, goal_t goal)
/* Disallow the optimization on doubles. The - operator is not */
/* rearrangable by K+R, and can cause floating point problems if */
/* converted to an add ((a + 1.0) - 1.0 shouldn't be folded). */
if (cnst(e2) && !tyfloating(e2->Ety))
if (cnst(e2) && !tyfloating(e2->Ety) &&
!tyvector(e2->Ety)) // don't do vectors until we get constant folding for them
{ e->E2 = el_una(OPneg,e2->Ety,e2);
e->Eoper = OPadd;
return optelem(e,GOALvalue);
Expand Down
9 changes: 9 additions & 0 deletions test/runnable/testxmm.d
Expand Up @@ -1456,6 +1456,15 @@ ubyte16 test11585(ubyte16* d)
return __simd(XMM.PCMPEQB, *d, *d);
}

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

void test13927(ulong2 a)
{
ulong2 b = [long.min, long.min];
auto tmp = a - b;
}

/*****************************************/

int main()
Expand Down

0 comments on commit c3a3200

Please sign in to comment.