From patchwork Thu Feb 16 04:56:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9576443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A2116049F for ; Thu, 16 Feb 2017 04:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52B3F28536 for ; Thu, 16 Feb 2017 04:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 478B1285A9; Thu, 16 Feb 2017 04:57:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02D0428536 for ; Thu, 16 Feb 2017 04:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753282AbdBPE5W (ORCPT ); Wed, 15 Feb 2017 23:57:22 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33115 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753164AbdBPE5U (ORCPT ); Wed, 15 Feb 2017 23:57:20 -0500 Received: by mail-wr0-f195.google.com with SMTP id i10so641686wrb.0 for ; Wed, 15 Feb 2017 20:57:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=edAZqBSS6M6BWEsoHgHB127Dnj5dXMSqFT5UBEo3+pQ=; b=QjEgLlKlLAUCJjscISWfstYlC0sD31Am2B2PySRUzAzF/5deGFT29oACaWIwsMr1Lc dl4LCxCVhbBWfGJTcKv803iZ7y1HvMVyzTIGBQOa9ho0Oqc9M9PlOtyhsFQY1336KjyA qI57JO4ENvyCAKxq15xIG1VwzRbmBV/PNGCNqIV56GtKdFwmfJN5nRwnSu6vr6wnooLV UGJyBLtE9/nJTDACGp0i5HsS0jwTFiSd9wXPml2JMvy6TwLhbLdEY0EvfttDWhFgAYKN Zakd8ac23DQA0xm8t8F3NNpb/uQHeprymLLrMv41lm/aAIliEIePJhz1cCLDGGXdEtXv vDbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=edAZqBSS6M6BWEsoHgHB127Dnj5dXMSqFT5UBEo3+pQ=; b=OiawfzRwS01tBltNSFDcHZYIejp+HfAdGSmHW2TxuJ9/oApbEcZWThkFrgVHTQQOvP Slu1UGU0KgIa3DoUFQGUl0hlGr4EeGt64zPEPxZyQrPRXwJhK/P7jFESzheBqsSraMq8 XESm+YNLXfjemKBCL0yXVZsR2vzaTc+gV0oyLqg70K9NP97tsF12doFIHN+N3pEdh4YC ExsOJ9PvHwpYEjBQiIzE+ZqL/Jte5du3kDjY9m1b9ufNZhWubNG/ZzAD1SQdDf7br4IH yKNj8WbiUVs1bpvZhzEo49hOVBoPchBQiJWUCliEtZAGVs2kwGGRi93DQnR+BcwKR3Gc /DaQ== X-Gm-Message-State: AMke39lKbefxjyTQuYGSTyHNQhGYsxkNdeZXJRDTUO4oHfHEc2oiQ/a19Z0XLxUTY46yiQ== X-Received: by 10.223.169.140 with SMTP id b12mr279199wrd.138.1487221039260; Wed, 15 Feb 2017 20:57:19 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:833:b500:30e2:fda3:9c55:1fd0]) by smtp.gmail.com with ESMTPSA id g11sm7313928wrb.63.2017.02.15.20.57.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Feb 2017 20:57:18 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Christopher Li , Luc Van Oostenryck Subject: [PATCH 05/16] fix clear_phi(), replace it by kill_instruction() Date: Thu, 16 Feb 2017 05:56:57 +0100 Message-Id: <20170216045708.50661-6-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170216045708.50661-1-luc.vanoostenryck@gmail.com> References: <20170216045708.50661-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP clear_phi() only replaces a phi-node's sources by VOID without adjusting the usage of these sources. As such it can't be used for cleaning things before removing an OP_PHI. Fix this by replacing calls to clear_phi() by calls to kill_instruction(). Signed-off-by: Luc Van Oostenryck --- simplify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simplify.c b/simplify.c index 17f1e2b61..ddd0aa9c5 100644 --- a/simplify.c +++ b/simplify.c @@ -110,7 +110,7 @@ static int if_convert_phi(struct instruction *insn) * the conditional branch too. */ insert_select(source, br, insn, p1, p2); - clear_phi(insn); + kill_instruction(insn); return REPEAT_CSE; } @@ -140,7 +140,7 @@ static int clean_up_phi(struct instruction *insn) if (same) { pseudo_t pseudo = last ? last->src1 : VOID; convert_instruction_target(insn, pseudo); - clear_phi(insn); + kill_instruction(insn); return REPEAT_CSE; } @@ -1142,7 +1142,7 @@ int simplify_instruction(struct instruction *insn) return simplify_cast(insn); case OP_PHI: if (dead_insn(insn, NULL, NULL, NULL)) { - clear_phi(insn); + kill_use_list(insn->phi_list); return REPEAT_CSE; } return clean_up_phi(insn);