From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6092 invoked by alias); 29 Jun 2013 20:08:18 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6021 invoked by uid 48); 29 Jun 2013 20:08:14 -0000 From: "amylaar at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/52267] a&~N where N has all the bits set up till a specific point can be folded to ((unsigned)a) < N Date: Sat, 29 Jun 2013 20:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.7.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: amylaar at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg01818.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52267 --- Comment #9 from Jorn Wolfgang Rennecke --- (In reply to Jorn Wolfgang Rennecke from comment #8) > (In reply to Georg-Johann Lay from comment #7) > > > I just rediced the test case to find this thinko; I don't know if there are > > more because of the sheer amount of values in this program. > > Here is a summary of the failing subtests / iteration counts: > f2,f1: i == 6,7 > f4,f5,f3: i == 13,15,16,24,25,31 > f7,f8,f6: i == 10..12,23 > f11,f9: i == 11,13,15,24,25,31 > f12,f10: i == 11,13,15,24,25,26,31 > f17: i == 12,13 > f21: i == 21,22,38..45 I've tried to shift/mask the values / tests to fit 16 bit ints while keeping to the spirit of the tests and leaving the int >= 32 bit case unchanged, but the various leading bits, 0000/ffff masking, and 16 bit value comparisons are just to intertwined for this to make any sense. I think we should simply restrict the test to target { ! int16 } .