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: [PR/13274] Fold subregs that are produced by zero_extend


On Tue, 20 Jan 2004, Richard Henderson wrote:
> On Tue, Jan 20, 2004 at 12:28:43PM +0100, Paolo Bonzini wrote:
> > +		    && subreg_lsb (x) / BITS_PER_UNIT
> > +		       >= GET_MODE_SIZE (GET_MODE (XEXP (elt->exp, 0))))
>
> Better.  Use GET_MODE_BITSIZE and you don't have to divide either.
>
> Roger, what do you think?

Sounds good.  My suggestion was that it should be beneficial to instead/also
implement this optimization (SUBREG (ZERO_EXTEND (...)) => const0_rtx
in simplify_subreg.  However, paolo's analysis shows that, in the current
example, simplify_subreg never gets called with a zero_extend argument.
As you know placing it in simplify_subreg would benefit the rest of the
compiler, but I'm surprised combine never attempts to combine these isns.

I'm happy to go with Paolo's patch.

Roger
--


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