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: new sign/zero extension elimination pass


On Thu, Oct 28, 2010 at 12:30 PM, Tom de Vries <tom@codesourcery.com> wrote:
> I agreed with Paolo in http://gcc.gnu.org/ml/gcc-patches/2010-10/msg01897.html
> that for the example with which I submitted the pass initially, it would make
> sense to handle it in fwprop. However, I also think that for the example
> mentioned in http://gcc.gnu.org/ml/gcc-patches/2010-10/msg01796.html, that
> wouldn't work, so we still need the new pass.

Well when I look at the tree dumps I see:
(short unsigned int) ((int) (*D.1255)[1] + (int) (*D.1255)[0])

So we should be optimizing this at the tree level such that we don't
see extra sign extends there.  We would optimize it such that it looks
like:
(short unsigned int)(*D.1255)[1] + (short unsigned int)(*D.1255)[0]

I think we need a tree combiner for that and fold to do the folding.
See PR 14844 for another case of the problem.

-- Pinski


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