This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PPro patch for egcs
- To: hjl at lucon dot org (H.J. Lu)
- Subject: Re: PPro patch for egcs
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 04 Jun 1998 00:20:58 -0600
- cc: john at feith dot com (John Wehle), egcs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <m0yhQH5-000268C@ocean.lucon.org>you write:
> > Not to be completely thick .... but why are only GT and LE relevant?
> >
>
> That is because of how CC works on x86. I believe you can find the
> answer in x86 reference manual. You can do
>
> # cd gcc/config/i386
> # grep CC_NO_OVERFLOW i386.c i386.h
>
> to see how it is used. Basically, we have to duplicate its usage
> for integer conditional moves.
Yup. HJ is right. This comes up once in a while on ports that
use cc0.
Basically, instructions may not set overflow/carry in a manner that
mimics a compare instruction. The compiler may remove the compare
instruction because it is believed to be redundant, when in fact, it
is not redundant because the later test needs to look at the
overflow or carry flags.
Depending on exactly how the overflow & carry bits are set, you
may have to restore the comparison if the condition is GT, GE,
LE or LT. I don't know the x86 well enough to know if only
a subset of those conditions need to be handled.
jeff