Skip to content

Commit

Permalink
Merge pull request #3794 from WalterBright/fix12057
Browse files Browse the repository at this point in the history
fix Issue 12057 - [ICE], backend/cg87.c 925
  • Loading branch information
yebblies authored and 9rnsr committed Jul 23, 2014
1 parent 2b6d709 commit 118e1a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/cg87.c
Expand Up @@ -922,7 +922,7 @@ code *fixresult87(elem *e,regm_t retregs,regm_t *pretregs)
else
{ if (*pretregs & mPSW)
{ if (!(retregs & mPSW))
{ assert(retregs & mST0);
{
c1 = genftst(c1,e,!(*pretregs & (mST0 | XMMREGS))); // FTST
}
}
Expand Down
13 changes: 13 additions & 0 deletions test/runnable/mars1.d
Expand Up @@ -1125,6 +1125,18 @@ void test9449()
if (arr[0].g != 4.0) assert(0);
}

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

bool prop12057(real x) { return false; }
double f12057(real) { return double.init; }
void test12057()
{
real fc = f12057(real.init);
if (fc == 0 || fc.prop12057) {}
}


////////////////////////////////////////////////////////////////////////

int main()
Expand Down Expand Up @@ -1159,6 +1171,7 @@ int main()
test7565();
test12833();
test9449();
test12057();
printf("Success\n");
return 0;
}

0 comments on commit 118e1a8

Please sign in to comment.