This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: AVR: CC0 to CCmode conversion
- From: Richard Henderson <rth at redhat dot com>
- To: Denis Chertykov <denisc at overta dot ru>
- Cc: Paul Schlie <schlie at comcast dot net>, gcc at gcc dot gnu dot org, Jan-Benedict Glaw <jbglaw at lug-owl dot de>
- Date: Sun, 20 Mar 2005 08:00:14 -0800
- Subject: Re: AVR: CC0 to CCmode conversion
- References: <BE61C6CA.985C%schlie@comcast.net> <ekea7fbz.fsf@localhost.localdomain>
On Sun, Mar 20, 2005 at 01:59:44PM +0300, Denis Chertykov wrote:
> The reload will generate addhi3 and reload will have a problem with
> two modified regs (ZCMP_FLAGS, CARRY_FLAGS) which will be a bad
> surprise for reload. :( As I remember.
In order to expose the flags register before reload, you *must*
have load, store, reg-reg move, and add operations that do not
modify the flags.
Note, for instance, that i386 "add" instruction always modifies
the flags, but the "lea" instruction does not. So we emit the
later when reload emits an add.
If you cannot meet these requirements, then you must represent
"setcc" and "compare-and-branch" patterns as a single insn until
after reload. You can then split them apart, followed by peep2
patterns to remove compare patterns that are redundant with
immediately preceeding arithmetic.
r~