This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize (CST1 << A) == CST2 (PR tree-optimization/66299)
- From: Richard Biener <rguenther at suse dot de>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Marek Polacek <polacek at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 9 Jun 2015 13:48:00 +0200 (CEST)
- Subject: Re: [PATCH] Optimize (CST1 << A) == CST2 (PR tree-optimization/66299)
- Authentication-results: sourceware.org; auth=none
- References: <20150528121545 dot GE27320 at redhat dot com> <20150528123436 dot GM10247 at tucnak dot redhat dot com> <alpine dot DEB dot 2 dot 11 dot 1505282124310 dot 2177 at laptop-mg dot saclay dot inria dot fr> <20150608151055 dot GR2756 at redhat dot com> <alpine dot DEB dot 2 dot 20 dot 1506081901550 dot 28961 at stedding dot saclay dot inria dot fr> <CAFiYyc2vfBzHGHQEkvRujiE2z-brW4J3P0R+TyjQuy44PZj0-A at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1506091305110 dot 9052 at stedding dot saclay dot inria dot fr>
On Tue, 9 Jun 2015, Marc Glisse wrote:
> On Tue, 9 Jun 2015, Richard Biener wrote:
>
> > > Tweaking it so that (6<<X)==0 becomes X>=31 for TYPE_OVERFLOW_WRAPS and
> > > false for TYPE_OVERFLOW_UNDEFINED is probably more controversial.
> >
> > Hm, yes. I think signed overflow != shift amount overflow, so testing the
> > overflow macros for this isn't valid.
>
> Would it be ok to always turn it to X>=31 then? (the value 31 is conveniently
> already computed in 'cand')
I think so.
Richard.