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: Geoff Keating <geoffk at geoffk dot org>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 03 Feb 2003 12:42:44 -0800
- Subject: Re: CANNOT_CHANGE_MODE changes for df/ra*
- References: <Pine.LNX.4.33.0302020136420.12676-100000@wotan.suse.de>
Michael Matz <matz@suse.de> writes:
> Hi,
>
> 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 ...)) ...)
all of these are partial modifies, and so this function should return
'true' on them.
IMO, this last part of the function would be much cleaner rewritten as:
return (isize > osize && isize > UNITS_PER_WORD)
rather than using double negatives.
--
- Geoffrey Keating <geoffk@geoffk.org>