------- Comment #23 from guenter at roeck-us dot net 2006-08-29 20:23 -------
Here is a test case:
double calc(double val, double *result)
{
double f = val - (double)((int)val);
*result = val - f;
if (!val)
return val - *result;
else
return val;
}
Compile with:
gcc testc2.c -S -mcpu=8548 -mfloat-gprs=double -o testc2.S
Generates the following (bad) code:
....
.L2:
evldd 0,24(31)
evstdd 0,40(31)
.L4:
evldd 9,40(31)
stw 9,48(31)
stw 10,52(31)
lwz 9,48(31)
....
"evldd 9,40(31)" is generated from "evldd%X1 %0,%y1".
Unfortunately, I don't know enough to have a clue
what needs to be changed to fix this, though I did find
out that simply replacing "evldd%X1 %0,%y1" with
"evldd%X1 %0,%y1\;evmergelo %L0,%0,%0" is insufficient
and causes problems elsewhere.
Should I file a new bug or reopen this one ?
--
guenter at roeck-us dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |guenter at roeck-us dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27287