This is the mail archive of the
mailing list for the GCC project.
Re: [PR/13274] Fold subregs that are produced by zero_extend
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: bonzini at gnu dot org, <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 Jan 2004 09:53:19 -0700 (MST)
- Subject: 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.