This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CANNOT_CHANGE_MODE changes for df/ra*


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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]