From patchwork Mon Apr 1 16:32:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Monakov X-Patchwork-Id: 1073011 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-498719-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ispras.ru Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="I04qVY1x"; 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 44XyZ56qDqz9sLt for ; Tue, 2 Apr 2019 03:32:55 +1100 (AEDT) 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:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=Mj4LSkMUOiuDOPNTqE9LQwpBTN8bcmX9m/DcPE7yGdf6PKButa GcySvLAkvuRZ5ZCotSB9RegmmWJ8Veb7GIdADR473Uf/y+ZvQXpCki0DnshCMbH5 JN3og4u77ospxI+w9M0lq+34efltXix5hfVhA9Sle+ru51umo1np7aQQo= 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:cc:subject:message-id:mime-version:content-type; s= default; bh=SGF4rL7syXSYWxnZ+Zb2W3JBxyk=; b=I04qVY1xv1n9/9XRwgYH 2ZbYDrgVWotNsXjaP6IDzg9Oei2lMcvwTk/d0kSRuNUkCWKzropWKx4nMcQCJH7r vyq8iB9A3vKzXmLSPLobllm75bFf4cBv9FFPlEMcVssX3f803bFpGKnU7g3lvjQF QDScB+06sj7lUPOic7ZaOuc= Received: (qmail 74203 invoked by alias); 1 Apr 2019 16:32:48 -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 74192 invoked by uid 89); 1 Apr 2019 16:32:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=H*F:D*ru X-HELO: smtp.ispras.ru Received: from bran.ispras.ru (HELO smtp.ispras.ru) (83.149.199.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 01 Apr 2019 16:32:46 +0000 Received: from monopod.intra.ispras.ru (monopod.intra.ispras.ru [10.10.3.121]) by smtp.ispras.ru (Postfix) with ESMTP id AF97E20A1C; Mon, 1 Apr 2019 19:32:44 +0300 (MSK) Date: Mon, 1 Apr 2019 19:32:44 +0300 (MSK) From: Alexander Monakov To: gcc-patches@gcc.gnu.org cc: Andrey Belevantsev Subject: [committed] sel-sched: update liveness in redirect_edge_and_branch hooks (PR 86928) Message-ID: User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Hi, This patch by Andrey fixes PR 86928 by avoiding leaving basic blocks without computed liveness info. 2019-04-01 Andrey Belevantsev PR rtl-optimization/86928 * sel-sched-ir.c (sel_redirect_edge_and_branch_force): Invoke compute_live if necessary. (sel_redirect_edge_and_branch): Likewise. * gcc.dg/pr86928.c: New test. diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index e8e508ef692..2f76e56ca8e 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -5642,6 +5642,8 @@ sel_redirect_edge_and_branch_force (edge e, basic_block to) recompute_dominator (CDI_DOMINATORS, to)); set_immediate_dominator (CDI_DOMINATORS, orig_dest, recompute_dominator (CDI_DOMINATORS, orig_dest)); + if (jump && sel_bb_head_p (jump)) + compute_live (jump); } /* A wrapper for redirect_edge_and_branch. Return TRUE if blocks connected by @@ -5702,6 +5704,8 @@ sel_redirect_edge_and_branch (edge e, basic_block to) set_immediate_dominator (CDI_DOMINATORS, orig_dest, recompute_dominator (CDI_DOMINATORS, orig_dest)); } + if (jump && sel_bb_head_p (jump)) + compute_live (jump); return recompute_toporder_p; } diff --git a/gcc/testsuite/gcc.dg/pr86928.c b/gcc/testsuite/gcc.dg/pr86928.c new file mode 100644 index 00000000000..1586a36f945 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr86928.c @@ -0,0 +1,25 @@ +/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -fnon-call-exceptions -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fselective-scheduling -fno-if-conversion -fno-tree-dce -w" } */ +/* { dg-additional-options "-m32" { target powerpc*-*-* } } */ + +int kn; + +void +gd (short int sk) +{ + char *as; + + while (sk < 1) + { + char *ci; + + if (*ci == 0) + *as += ci; + + for (kn = 0; kn < 18; ++kn) + { + } + + ++sk; + } +}