From patchwork Sat Apr 9 12:07:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Pokorn=C3=BD?= X-Patchwork-Id: 695881 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p39C7Ae0006504 for ; Sat, 9 Apr 2011 12:07:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754393Ab1DIMHJ (ORCPT ); Sat, 9 Apr 2011 08:07:09 -0400 Received: from fep14.mx.upcmail.net ([62.179.121.34]:42973 "EHLO fep14.mx.upcmail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754294Ab1DIMHI (ORCPT ); Sat, 9 Apr 2011 08:07:08 -0400 Received: from edge02.upcmail.net ([192.168.13.237]) by viefep14-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20110409120706.SMIN1458.viefep14-int.chello.at@edge02.upcmail.net>; Sat, 9 Apr 2011 14:07:06 +0200 Received: from [192.168.42.128] ([94.112.231.238]) by edge02.upcmail.net with edge id VQ741g02259GDcW02Q75Gy; Sat, 09 Apr 2011 14:07:06 +0200 X-SourceIP: 94.112.231.238 Message-ID: <4DA04BE8.9060706@seznam.cz> Date: Sat, 09 Apr 2011 14:07:04 +0200 From: =?ISO-8859-1?Q?Jan_Pokorn=FD?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: sparse@chrisli.org CC: linux-sparse@vger.kernel.org Subject: [PATCH 2/2] better dealing with OP_PHISOURCE insn References: <4DA048C2.8060501@seznam.cz> In-Reply-To: <4DA048C2.8060501@seznam.cz> X-Enigmail-Version: 1.1.1 X-Cloudmark-Analysis: v=1.1 cv=CqMFsqQC4gx7bBgpmnW/wKYuJF/a5pXPeCAfngFtYkU= c=1 sm=0 a=gr3JKtqGReIA:10 a=y5wzFqU1M9sA:10 a=8nJEP1OIZ-IA:10 a=r5ftzNTv9iKu92gQ-EAA:9 a=kpbyrpMhg0AvEp_Ds-sA:7 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 09 Apr 2011 12:07:10 +0000 (UTC) Remove checking for a case that (most probably) never happens as the only expected instruction is OP_PHISOURCE. For the sake of assurance, assert added with a comment easing the fix if the assumption of OP_PHISOURCE is wrong (better then masking a problem). Also, use `def' as existing shortcut for `phi->def'. Tested the same way as the previous patch (together). Signed-off-by: Jan Pokorny --- liveness.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/liveness.c b/liveness.c index eeff0f7..02ceed9 100644 --- a/liveness.c +++ b/liveness.c @@ -23,11 +23,9 @@ static void phi_defines(struct instruction * phi_node, pseudo_t target, def = phi->def; if (!def || !def->bb) continue; - if (def->opcode == OP_PHI) { - phi_defines(def, target, defines); - continue; - } - defines(def->bb, phi->def, target); + /* if this ever fails (very unlikely), it's a sign of a regression */ + assert(def->opcode == OP_PHISOURCE); + defines(def->bb, def, target); } END_FOR_EACH_PTR(phi); }