From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7479 invoked by alias); 29 Apr 2016 12:09:55 -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 7424 invoked by uid 89); 29 Apr 2016 12:09:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=51513, jump-table, jumptable, check! X-HELO: e34.co.us.ibm.com Received: from e34.co.us.ibm.com (HELO e34.co.us.ibm.com) (32.97.110.152) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 29 Apr 2016 12:09:44 +0000 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Apr 2016 06:09:40 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 29 Apr 2016 06:09:26 -0600 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: bergner@vnet.ibm.com X-IBM-RcptTo: gcc-patches@gcc.gnu.org;richard.guenther@gmail.com Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id E37DD19D8045; Fri, 29 Apr 2016 06:09:09 -0600 (MDT) Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u3TC9P2J34537664; Fri, 29 Apr 2016 05:09:25 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A7A2C6037; Fri, 29 Apr 2016 06:09:25 -0600 (MDT) Received: from sig-9-77-146-127.ibm.com (unknown [9.77.146.127]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id BFFF4C603C; Fri, 29 Apr 2016 06:09:24 -0600 (MDT) Message-ID: <1461931764.4256.25.camel@vnet.ibm.com> Subject: Re: [PATCH] Fix PR tree-optimization/51513 From: Peter Bergner To: Richard Biener Cc: "gcc-patches@gcc.gnu.org" Date: Fri, 29 Apr 2016 12:09:00 -0000 In-Reply-To: References: <1461886509.4256.14.camel@vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16042912-0017-0000-0000-000029D01381 X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg01996.txt.bz2 On Fri, 2016-04-29 at 11:56 +0200, Richard Biener wrote: > Your testcase passes '2' where it passes just fine. If I pass 3 as which > I indeed get an abort () but you can't reasonably expect it to return 13 then. Bah, I added an extra case and didn't change the argument. :-( Let me fix that and then dig into the current behavior. > So I fail to see the actual bug you are fixing and I wonder why you do stuff > at the GIMPLE level when we only remove the unreachable blocks at RTL > level CFG cleanup. Iff then the "fix" should be there. I actually started out trying to fix the problem in rtl first, but ran into multiple problems, which at the time made it seem like fixing this at the GIMPLE level was a better solution. > But as said, the behavior is expected - in fact the jump-table code should > be optimized for a unreachable default case to simply omit the range > check! That would be a better fix (also avoiding the wild branch). I know I've seen the wild branch due to normal case statements having __builtin_unreachable() too, so it's not just a default case problem. That said, I'll have a look to see whether we can fix unreachable normal case statements too. Thanks. Peter