ppc-eabi execute/fp-cmp-1.c -O2 failure
Joern Rennecke
amylaar@cygnus.co.uk
Thu Sep 18 15:06:00 GMT 1997
execute/fp-cmp-1.c fails on ppc-eabi when compiled with -O2 . This happens
because jump does an optimization that is equivalent to reversing the
condition for a floating point test - one which cannot be properly reversed.
The patch below is a bit dated, but I have just checked that it applies
cleanly to ss-970912 and that it fixes the bug there - which is still present
in the unpatched ss-970912.
I think it should be safe because
- It just restricts the circumstances under which an option may be performed.
- the parameters passed to can_reverse_comparison_p have already been used
to calculate code1. Thus, they should be valid.
Tue Apr 29 22:45:51 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
* jump.c (thread_jumps): check can_reverse_comparison_p before
threading a reversed-condition jump.
*** jump.c.97r1-orig Fri Feb 28 06:34:33 1997
--- jump.c Tue Apr 29 22:45:51 1997
*************** thread_jumps (f, max_reg, flag_before_lo
*** 4607,4613 ****
if (rtx_equal_for_thread_p (b1op0, b2op0, b2)
&& rtx_equal_for_thread_p (b1op1, b2op1, b2)
&& (comparison_dominates_p (code1, code2)
! || comparison_dominates_p (code1, reverse_condition (code2))))
{
t1 = prev_nonnote_insn (b1);
t2 = prev_nonnote_insn (b2);
--- 4607,4616 ----
if (rtx_equal_for_thread_p (b1op0, b2op0, b2)
&& rtx_equal_for_thread_p (b1op1, b2op1, b2)
&& (comparison_dominates_p (code1, code2)
! || (comparison_dominates_p (code1, reverse_condition (code2))
! && can_reverse_comparison_p (XEXP (SET_SRC (PATTERN (b1)),
! 0),
! b1))))
{
t1 = prev_nonnote_insn (b1);
t2 = prev_nonnote_insn (b2);
More information about the Gcc
mailing list