This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: CANNOT_CHANGE_MODE changes for df/ra*
- From: Michael Matz <matz at suse dot de>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 3 Feb 2003 21:59:10 +0100 (CET)
- Subject: Re: CANNOT_CHANGE_MODE changes for df/ra*
Hi,
On 3 Feb 2003, Geoff Keating wrote:
> > this changes df.c/ra*.c to make use of the new interface of
> > CANNOT_CHANGE_MODE_CLASS. It additionally adds a new flag to df.h which
> > will be of use later, and a fix to read_modify_subreg_p (to make GCC
> > bootstrap with activated new allocator).
> >
> > Bootstraps without regressions on i686-linux (Ada untested). I
> > additionally tested, if the new ra is still working somewhat, so it also
> > bootstraps without regressions when the new ra is activated by default,
> > when Java is deactivated.
> >
> > The changes to df.* need approval. OK for mainline?
>
> This patch is OK, except that in this code:
>
> + /* Paradoxical subreg writes don't leave a trace of the old content. */
> if (isize <= osize)
> - return true;
> + return false;
> if (isize <= UNITS_PER_WORD)
> return false;
> - if (osize > UNITS_PER_WORD)
> + if (osize >= UNITS_PER_WORD)
> return false;
> return true;
> }
>
> the logic is wrong. Consider when word_mode is SImode:
>
> (set (subreg:HI (reg:DI ...)) ...)
> (set (subreg:SI (reg:DI ...)) ...)
> (set (subreg:DI (reg:TI ...)) ...)
Ahh, one of my favourite topics, subregs ;-) In the new register
allocator they are tracked precisely (at least wordwise), so there partial
writes never result in an additional use. The reason is, that e.g.
(sub:HI (reg:SI )) clobbers the whole word (SImode), ergo is a complete
def. Similar for (sub:SI (reg:DI)). This sets the complete half, but
doesn't need the other one (and it clobbers nothing). I.e for the new RA
I've deactivated that function at all. Hmm, I guess for other users of
df.c that don't do that, the definition of read_modify_subreg_p() is now
wrong indeed. OK, I'll change the function to do, what you suggested, and
introduce a flag for df_flags, which can be set by the new RA to not call
that function.
> return (isize > osize && isize > UNITS_PER_WORD)
>
> rather than using double negatives.
Ciao,
Michael.