This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
A bug in output_fp_cc0_set ()?
- To: john at feith dot com (John Wehle)
- Subject: A bug in output_fp_cc0_set ()?
- From: hjl at lucon dot org (H.J. Lu)
- Date: Sat, 13 Jun 1998 14:27:53 -0700 (PDT)
- Cc: egcs-bugs at cygnus dot com
Hi,
output_fp_cc0_set () in config/i386/386.c has some strange codes:
next = next_cc0_user (insn);
if (GET_CODE (next) == JUMP_INSN
&& GET_CODE (PATTERN (next)) == SET
&& SET_DEST (PATTERN (next)) == pc_rtx
&& GET_CODE (SET_SRC (PATTERN (next))) == IF_THEN_ELSE)
code = GET_CODE (XEXP (SET_SRC (PATTERN (next)), 0));
else if (GET_CODE (PATTERN (next)) == SET)
code = GET_CODE (SET_SRC (PATTERN (next)));
else
return "sahf";
I don't see how
GET_CODE (next) == JUMP_INSN
and
GET_CODE (PATTERN (next)) == SET
can both be true. I think the correct one should be
next = next_cc0_user (insn);
if (GET_CODE (PATTERN (next)) == SET
&& SET_DEST (PATTERN (next)) == pc_rtx
&& GET_CODE (SET_SRC (PATTERN (next))) == IF_THEN_ELSE)
code = GET_CODE (XEXP (SET_SRC (PATTERN (next)), 0));
else if (GET_CODE (PATTERN (next)) == SET)
code = GET_CODE (SET_SRC (PATTERN (next)));
else
return "sahf";
The same code appears twice in output_fp_cc0_set (). BTW, we never saw
any bugs caused by it since integer/fp conditional moves were never
really enabled for fp comparisons.
H.J.