This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PPro patch #2
- To: hjl at lucon dot org (H.J. Lu)
- Subject: Re: PPro patch #2
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 05 Jun 1998 01:35:17 -0600
- cc: egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
Note, you did not send this to egcs-patches. Please do not
send patches directly to me. Send them to egcs-patches so that
everyone can comment on them.
In message <m0yhbhR-000268C@ocean.lucon.org>you write:
> Here is the second PPro patch.
Do you have a testcase for this bug?
> /* This insn requires the top of stack to be the destination. */
>
> + /* If the comparison operator is an FP comparison operator,
> + it is handled correctly by compare_for_stack_reg () who
> + will move the destination to the top of stack. But if the
> + comparison operator is not an FP comparison operator, we
> + have to handle it here. */
> + if (get_hard_regnum (regstack, *dest) >= FIRST_STACK_REG
> + && REGNO (*dest) != regstack->reg[regstack->top])
> + emit_swap_insn (insn, regstack, *dest);
> +
I don't understand how this comment applies.
Don't we get to this code for any conditional move, regardless of
whether or not this is an FP comparison operator?
The format of a conditional move is the same regardless of
the mode of the comparison operator:
(set (dest) (if_then_else (comparison_operator
(comparison_arg1)
(comparison_arg2))
(result1)
(result2)))
So, when we call subst_stack_regs with such a pattern, we will always
to into the IF_THEN_ELSE case, regardless of what the comparison
operator is?!? What am I missing?
How can we get into compare_for_stack_reg for a conditional move?
I don't see how that can happen anymore.
At the least the comment needs updating, this may point to a need
for you to look more closely at the problem you're trying to solve.
If we decide it's no longer possible to get into compare_for_stack_reg
for conditional moves, then we should remove the cmove support
from that function.
jeff