From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31119 invoked by alias); 9 Jun 2015 11:49:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 31109 invoked by uid 89); 9 Jun 2015 11:49:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 09 Jun 2015 11:49:44 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 77E10ADB6; Tue, 9 Jun 2015 11:49:41 +0000 (UTC) Date: Tue, 09 Jun 2015 11:57:00 -0000 From: Richard Biener To: Marc Glisse cc: Richard Biener , Marek Polacek , Jakub Jelinek , GCC Patches Subject: Re: [PATCH] Optimize (CST1 << A) == CST2 (PR tree-optimization/66299) In-Reply-To: Message-ID: References: <20150528121545.GE27320@redhat.com> <20150528123436.GM10247@tucnak.redhat.com> <20150608151055.GR2756@redhat.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-06/txt/msg00653.txt.bz2 On Tue, 9 Jun 2015, Richard Biener wrote: > On Tue, 9 Jun 2015, Marc Glisse wrote: > > > On Tue, 9 Jun 2015, Richard Biener wrote: > > > > > > Tweaking it so that (6<=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. Or even ((unsigned)X - 31) < 1 (I probably got that wrong) to properly say X>=29 && X<32, that is, preserve the implicit upper bound on X we have because it is used in a shift. Richard. > Richard. > -- Richard Biener SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nuernberg)