From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Wilson To: hjl@lucon.org (H.J. Lu) Cc: law@cygnus.com, scox@cygnus.com, crux@pool.informatik.rwth-aachen.de, egcs@cygnus.com Subject: Re: More fp bug in egcs Date: Sun, 03 May 1998 20:10:00 -0000 Message-id: <199805032246.PAA08295@rtl.cygnus.com> References: X-SW-Source: 1998-05/msg00067.html 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