From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23432 invoked by alias); 2 May 2016 08:49:16 -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 23419 invoked by uid 89); 2 May 2016 08:49:15 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=bergner, Hx-languages-length:1460 X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 02 May 2016 08:49:14 +0000 Received: by mail-wm0-f46.google.com with SMTP id v200so21150254wmv.1 for ; Mon, 02 May 2016 01:49:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=pK6wBNJpqdkx9+P9wVuVd53qYNBzpTMWbkSPexCIMg8=; b=CsqsYBbHRcgMkq59+WIxtzsXTXKX7Fy58RSsDK1du2QL9xYM4luuhImaQKMY6TP7aU oC2VtnXT8efmYpjRip7j8KldyyRAFVkdXxtkVOzxKyjE0QxbsC++XpfHc5E6K1pNrOJf pezVE3tn1fM9jxOep/WXgvfs/jrrMejkLElWWKp53StwN/+0n8aPE6/6xNVO2xEHdapb CtLgf2kPCMNsrKSjRExCNDU6KyuC+yA6hg1m7YQhyNtR+342Opby/mBQVZNtRoLHeulr qne2v/i7rz4v/VigCdK5PHHBf1voWZD6E92EZWXeIS7u0CNg3HLV9ajEgjYK6t1I1sDw WKJw== X-Gm-Message-State: AOPr4FVzo07UTy1xz5/SrpNr4drizyVyOq2IO6KwQe1chAZE7IW5qI7pF7zJdzencJKcrZjcJHdOjDgB5WIoGQ== MIME-Version: 1.0 X-Received: by 10.28.168.133 with SMTP id r127mr18188299wme.9.1462178951397; Mon, 02 May 2016 01:49:11 -0700 (PDT) Received: by 10.194.113.102 with HTTP; Mon, 2 May 2016 01:49:11 -0700 (PDT) In-Reply-To: <1461931764.4256.25.camel@vnet.ibm.com> References: <1461886509.4256.14.camel@vnet.ibm.com> <1461931764.4256.25.camel@vnet.ibm.com> Date: Mon, 02 May 2016 08:49:00 -0000 Message-ID: Subject: Re: [PATCH] Fix PR tree-optimization/51513 From: Richard Biener To: Peter Bergner Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00035.txt.bz2 On Fri, Apr 29, 2016 at 2:09 PM, Peter Bergner wrote: > 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. Again, the wild jump is not a bug but at most a missed optimization (to remove it). Richard. > Peter > >