diff --git a/compiler/src/dmd/backend/cgelem.d b/compiler/src/dmd/backend/cgelem.d index 33bd56ec63b..79d0253fdd6 100644 --- a/compiler/src/dmd/backend/cgelem.d +++ b/compiler/src/dmd/backend/cgelem.d @@ -3906,6 +3906,10 @@ static if (0) // If floating point, replace (x = -y) with (x = y ^ signbit) if (op2 == OPneg && (tyreal(e2.Ety) || tyimaginary(e2.Ety)) && (e2.E1.Eoper == OPvar || e2.E1.Eoper == OPind) && + /* Turned off for x87 because of https://issues.dlang.org/show_bug.cgi?id=24819 + * and this is unnecessary anyway because of the FCHS x87 instruction + */ + !config.inline8087 && /* Turned off for XMM registers because they don't play well with * int registers. */ diff --git a/compiler/src/dmd/backend/debugprint.d b/compiler/src/dmd/backend/debugprint.d index 6ed1943c13a..a5848d48ed3 100644 --- a/compiler/src/dmd/backend/debugprint.d +++ b/compiler/src/dmd/backend/debugprint.d @@ -509,7 +509,7 @@ void numberBlocks(block *startblock) @trusted void WRfunc(const char* msg, Symbol* sfunc, block* startblock) { - printf("............%s...%s().............\n", msg, sfunc.Sident.ptr); + printf("............%s...%s()\n", msg, sfunc.Sident.ptr); numberBlocks(startblock); for (block *b = startblock; b; b = b.Bnext) WRblock(b); diff --git a/compiler/src/dmd/backend/dout.d b/compiler/src/dmd/backend/dout.d index d6301c36d1b..17f6ad1d28d 100644 --- a/compiler/src/dmd/backend/dout.d +++ b/compiler/src/dmd/backend/dout.d @@ -862,7 +862,7 @@ private void writefunc2(Symbol *sfunc, ref GlobalOptimizer go) { func_t *f = sfunc.Sfunc; - //printf("writefunc(%s)\n",sfunc.Sident.ptr); + debugb && printf("=========== writefunc %s ==================\n",sfunc.Sident.ptr); //symbol_print(sfunc); debug debugy && printf("writefunc(%s)\n",sfunc.Sident.ptr); diff --git a/compiler/test/runnable/test24819.d b/compiler/test/runnable/test24819.d new file mode 100644 index 00000000000..3ba374bed36 --- /dev/null +++ b/compiler/test/runnable/test24819.d @@ -0,0 +1,18 @@ +import core.stdc.stdio; + +pragma(inline, true) +double sqrt(double x) +{ + static import core.math; + return core.math.sqrt(x); +} + +int main() +{ + double q = -5.0; + double r = q + 1.0; + double result = sqrt(-r); + //printf("%f\n", result); + assert(result == 2); + return 0; +}