Jump optimisation patches
Michael P. Hayes
michaelh@ongaonga.chch.cri.nz
Mon Feb 2 15:13:00 GMT 1998
Jeffrey A Law writes:
> Don't you also need one in the conditional for this optimization:
>
> /* If branches are expensive, convert
> if (foo) bar++; to bar += (foo != 0);
> and similarly for "bar--;"
>
I don't think so. It appears that this optimisation is caught
by the more general test (circa line 1000 in jump.c) for targets
that don't have CC0. The patches I submitted were to fix a problem
for those targets where an insn was moved into a place where
it clobbered something required by the following insn (usually
the contents of the CC register).
More information about the Gcc
mailing list