From patchwork Wed Aug 9 11:28:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 799675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-460092-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ykt2qd0+"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xS8D40Fgwz9s82 for ; Wed, 9 Aug 2017 21:28:50 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=xbMb6do4e4fmGhrbguDITZekka5Cje6XEXvJYAudKPPfaXpU//aMk lMugJ5eLGbapRLRbRTOlXqHcuuh2P8ZGEh5vhLcjR4dAIq/orJzmVrNO4ucYbSse qZlw0GuCMz3zkQp3Ph/Ikmm+a1tRAx/s4fsNpyYSCjO/F9our1IULk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=9NND3XNQjzXUZcREVkWus4uD2dU=; b=ykt2qd0+YEWvjPr4JzGH ZlmR3FFPh4lre+0Js1cr8KX9H6smO+jM3SW10AMg1msQJ96poDWLkPVwJAlNKDtH sVguXsdnun/nyGlqwRAHcuiNSecBgMXcZMGI7axD2Aa34j9mupYG5c0qTyDrwveU Bx31qPX583H/ZflgZwOizTk= Received: (qmail 3754 invoked by alias); 9 Aug 2017 11:28:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 3728 invoked by uid 89); 9 Aug 2017 11:28:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=38000 X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Aug 2017 11:28:37 +0000 Received: by mail-pf0-f193.google.com with SMTP id p13so5886690pfd.4 for ; Wed, 09 Aug 2017 04:28:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=5bTzl3wn57393YNuqBQcfFnGaF8OvbTqVWM+qWA6nn4=; b=alw9qN35fAXhnf7tUZb60CXagbOUt1BbRscIkFOHcKHzAqLv4wRZ/sydk1YM4Ehym2 Wyd74J5WOlBkoGowAZ7815LKxHl37CxwLC8qFyB2+S1LXd+ZYbS+nV4LnGxiZexEzsdK yhayOS4tS44/Vy+Jik1FyeQX857/M912BL5UTtnjib+M1BvWK2tGo1qFiXGVlNdKZhrk hd788A2FuvebjaMhjFL8meHoTCb6Ol37JWHsvyI7DBYyl4N/3d5n/q+8MrgtFJrdp0VY L90KWmSnO6R/jVU6/1Abi33480kTQs/vRQK/T0KTDClrIR/sp/lI14GFVUymgr5y0KwV ofCQ== X-Gm-Message-State: AHYfb5iunnwyOfQXJww+2cV64fERUmvaSxXmlIWYzt9RsCyg30qlh1dP DVOQKvyx7trk5twM X-Received: by 10.84.177.67 with SMTP id w61mr8786215plb.112.1502278116069; Wed, 09 Aug 2017 04:28:36 -0700 (PDT) Received: from bubble.grove.modra.org (CPE-58-160-71-80.tyqh2.lon.bigpond.net.au. [58.160.71.80]) by smtp.gmail.com with ESMTPSA id r82sm8985348pfe.0.2017.08.09.04.28.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Aug 2017 04:28:35 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 8B387C03BA; Wed, 9 Aug 2017 20:58:31 +0930 (ACST) Date: Wed, 9 Aug 2017 20:58:31 +0930 From: Alan Modra To: gcc-patches@gcc.gnu.org Subject: [PATCH] PR81747, ICE in operator[] Message-ID: <20170809112831.GH16312@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes The testcase in this PR is failing in cse2 when processing the following basic block. (note 31 30 389 9 [bb 9] NOTE_INSN_BASIC_BLOCK) (jump_insn 389 31 39 9 (parallel [ (set (pc) (if_then_else (ne (reg:DI 138) (const_int 1 [0x1])) (label_ref:DI 39) (pc))) (set (reg:DI 138) (plus:DI (reg:DI 138) (const_int -1 [0xffffffffffffffff]))) (clobber (scratch:CC)) (clobber (scratch:DI)) ]) "/home/alan/src/tmp/pr81747.c":19 832 {ctrdi_internal1} (int_list:REG_BR_PROB 38000 (nil)) -> 39) ;; succ: 13 [always (guessed)] (FALLTHRU,LOOP_EXIT) The insn is rather odd. It meets single_set by virtue of reg 138 being dead, and since the branch destination is the fall-through, the whole basic block could be deleted.. Regardless of whether this insn should have been deleted earlier, it seems wrong to try to infer anything about the condition based on the jump destination when we have a degenerate conditional jump that branches to its fall-through. Bootstrapped and regression tested powerpc64le-linux. OK? PR rtl-optimization/81747 * cse.c (cse_extended_basic_block): Don't attempt to record equivalences for degenerate conditional jumps that branch to their fall-through. diff --git a/gcc/cse.c b/gcc/cse.c index 6a968d1..85be372 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -6640,6 +6640,7 @@ cse_extended_basic_block (struct cse_basic_block_data *ebb_data) equivalences due to the condition being tested. */ insn = BB_END (bb); if (path_entry < path_size - 1 + && EDGE_COUNT (bb->succs) == 2 && JUMP_P (insn) && single_set (insn) && any_condjump_p (insn))