From patchwork Sat Mar 11 15:47:22 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: 9618805 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 5A258604D9 for ; Sat, 11 Mar 2017 15:49:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48A292871F for ; Sat, 11 Mar 2017 15:49:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BEAB2874A; Sat, 11 Mar 2017 15:49:47 +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 C699828744 for ; Sat, 11 Mar 2017 15:49:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753988AbdCKPtp (ORCPT ); Sat, 11 Mar 2017 10:49:45 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36695 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755335AbdCKPto (ORCPT ); Sat, 11 Mar 2017 10:49:44 -0500 Received: by mail-wm0-f68.google.com with SMTP id v190so3364299wme.3 for ; Sat, 11 Mar 2017 07:49:32 -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=wS5XHkU0LBikiHgp00h4Mp8Z8Hm1IupjIKb+0F1s5xM=; b=s3vFgWMofYnMH2dCQFusTR95pIr5iiUwiYh3pcwKLhRFW7olJEyb2F7EwnS7TSow+J b9d8mJp6r8lEREGfHqEsNkqV9gEv+5Biw2vnUln+gQ2Q3pk8hN4B9ItBF8S7uy0bSK9t 0C/Iywm2Kh4VFnKRVpPd5ejzgW+josAJAOlg7OoJWiWUryA4Nc4x1+/RYpNVAuNRRQud hhEDXSjBTr8RrWVgTek6jYTynsUjjuVIckq3iBZNtkpgfG8JETxR2ZpPJcwiwkmXeyc4 k0XvMYriT2dYVGa9/AsaYj19rbRC9I2YKFmXgNZ3Pk7xV7LDmeDNO0w/Z+vc+Vw0O19u fIxw== 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=wS5XHkU0LBikiHgp00h4Mp8Z8Hm1IupjIKb+0F1s5xM=; b=M970625EAhC8Y2zuqGUFiq1KdshDhQw2/B98AnquK5F73FrTPdLJFHI3UoH15nG5iS AlyYVYpOMgT/SsungIP8dvFKsZE9lnSb+tjaC34RtluP6pcGja1WFBQtUtgr6IGOx2IG 9vuUmXpLdFZ1Xj/Tj8CDa6X7/O86p34y6iYeGkC3j5xzHp5QkYY+Z2XWBoWQP43NJJb7 9f9PwVg7cDjNCgyhQPK4o5WhRSO7GfnAxQDL1PrtBHRZOhI0+bb4CFid5zNTCB1KTqwG 01zj/paj3u8ArOgcLxjLE80DJzt+oqZjnx61BDfLSuimF35pqSWgT1oyOS5PKchaIYJH zOug== X-Gm-Message-State: AFeK/H02rnixGJU4c1fldoJ+XOfrl+ueYbPplrXn5rlV/F+muMZa0sTKVZrWLsmaJH6MIA== X-Received: by 10.28.5.72 with SMTP id 69mr3382713wmf.6.1489247371845; Sat, 11 Mar 2017 07:49:31 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:8df:aa00:8824:8320:e6e0:1e9b]) by smtp.gmail.com with ESMTPSA id m29sm17794685wrm.38.2017.03.11.07.49.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Mar 2017 07:49:31 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Dibyendu Majumdar , Christopher Li , Jeff Garzik , Pekka Enberg , Luc Van Oostenryck Subject: [PATCH v0 1/4] be more careful with concat_user_list() Date: Sat, 11 Mar 2017 16:47:22 +0100 Message-Id: <20170311154725.87906-2-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170311154725.87906-1-luc.vanoostenryck@gmail.com> References: <20170311154725.87906-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 In convert_instruction_target(), once all users have been converted the old user list is concatened to the one of the replacing pseudo. But this pseudo may be one for which a user list is meaningless, like PSEUDO_VAL. While as such it's not a problem, it inhibit the reuse of the users pointer for other uses. Fix this by doing the concatenation only if the pseudo can have an use-list. Signed-off-by: Luc Van Oostenryck --- flow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flow.c b/flow.c index 8111e1ae6..6878c0b4c 100644 --- a/flow.c +++ b/flow.c @@ -254,7 +254,8 @@ void convert_instruction_target(struct instruction *insn, pseudo_t src) *pu->userp = src; } } END_FOR_EACH_PTR(pu); - concat_user_list(target->users, &src->users); + if (has_use_list(src)) + concat_user_list(target->users, &src->users); target->users = NULL; }