This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: More fp bug in egcs
- To: hjl at lucon dot org (H.J. Lu)
- Subject: Re: More fp bug in egcs
- From: Jim Wilson <wilson at cygnus dot com>
- Date: Sun, 03 May 1998 15:46:17 -0700
- cc: law at cygnus dot com, scox at cygnus dot com, crux at pool dot informatik dot rwth-aachen dot de, egcs at cygnus dot com
Here is the trimmed down test case. I am not sure if your patch is
correct. If you take look at the stack RTL dump, you will see SF 1 in
is used as the input for the next insn:
It is supposed to be used by the next instruction. This is the output reload
that copies the input/output value to the stack slot where it lives. However,
since this value is dead, it will never be read from the stack slot, and hence
it doesn't matter what this value is.
The only problem here is that the code is inefficient, but since this case
can only happen when not optimized, this is not a problem.
I don't know if it is correct. Did gcc know %st(0) was not the same
%st(0) before?
Yes, gcc knows that %st(0) was clobbered. This is why the following
instruction is storing the clobbered value back to the stack slot where it
lives.
When considering how to fix this bug, it is important to separate what the
RTL means from what the actual x86 FP instructions are. My patch fixes the
problem by synthesizing a missing instruction. This is a perfectly valid thing
to do. This is no different than using two 4-byte loads to make a 8-byte load.
It is just a bit harder to understand because the FP stack is involved.
Jim