This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: rs6000-specific ICE
- From: Dale Johannesen <dalej at apple dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Dale Johannesen <dalej at apple dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 18 Oct 2002 16:44:38 -0700
- Subject: Re: Patch: rs6000-specific ICE
On Friday, October 18, 2002, at 03:26 PM, Geoff Keating wrote:
Dale Johannesen <dalej@apple.com> writes:
This rs6000.md pattern
;; If we are comparing the result of two comparisons, this can be done
;; using creqv or crxor.
is too aggressive. It assumes that for any
branch_comparison_operator,
either it or its reversal qualifies as a
branch_positive_comparison_operator.
This is not the case for floating LE, for example. This adds a test
so the pattern is not matched in this case. Bootstrapped and tested
on Darwin.
When -ffast-math is present, the inverse of LE is GT which is a
positive condition.
That's not the inverse that's computed now, and you're saying
that's the bug. You're right.
rs6000_reverse_condition was not supposed to be used for RTL
generation. It is safe only for use in output_cbranch and similar,
that is for assembly generation, as it can generate RTL which doesn't
match the machine.
Too bad there's no comment to this effect.
I think the right fix for this problem is to write
a different routine for use by this pattern that knows about
flag_unsafe_math_optimizations, or better yet copy the current
rs6000_reverse_condition into the one place in output_cbranch where it
is used and then fix rs6000_reverse_condition to do the right thing
for RTL.
Agreed. I withdraw the current patch, and I'll be back.