This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PPro patch for egcs
- To: john at feith dot com (John Wehle)
- Subject: Re: PPro patch for egcs
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sat, 06 Jun 1998 00:24:14 -0600
- cc: hjl at lucon dot org, egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199806052058.QAA03893@jwlab.FEITH.COM>you write:
> > > Does final.c only remove tests / comparisons against zero?
> > Nope. It can remove any instruction that sets cc0.
>
> So can the following (contrived) code
>
> set a = 6
> set b = 5
> set c = MINUS a b sets CC_NO_OVERFLOW
>
> set cc0 = COMPARE a b
> set d IF_THEN_ELSE GE ...
>
> get turned into
>
> set a = 6
> set b = 5
> set c = MINUS a b sets CC_NO_OVERFLOW
>
> set d IF_THEN_ELSE GE ...
It can if the port is set up to allow such optimizations.
However, most ports only handle removal of "tst" insns (compares
against zero). I don't know what the x86 port is set up to optimize.
Jeff
PS. A "tst" insn looks like (set (cc0) (reg/mem))