From patchwork Thu Sep 14 20:39:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 139826 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp613077vqi; Thu, 14 Sep 2023 13:40:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYrqpHdMBBUCBBr8fq9aIbCc9a00WgB2LWFryNKXklr2jmOPdwaqHlxmFCUFy1bORE80gv X-Received: by 2002:a17:907:7602:b0:9a1:ec3d:9004 with SMTP id jx2-20020a170907760200b009a1ec3d9004mr5072114ejc.9.1694724004524; Thu, 14 Sep 2023 13:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694724004; cv=none; d=google.com; s=arc-20160816; b=QnCvmxXC2yttHlBXYMS95uabSlTgoWXQLy/SvsQHnj24K17IDzTANm3yveRKD2x3ro ar9/Lx8nay9G/Ck9hzeCxDe+5ipblMnJyvBtuLV5lYV8oyTcRpqkZdJmfFq5BYRmugVV 4rCafKEzusx5pC+Q/bvYmNhHM69FXnNXwfTP2EBojcFe5R/j7zqhZzBPmD7qf5tHL11E bFKLbcDj4HQl0/SZFIOBPRj2nyW31UIQgUKZjg0KMyx5B9HEBJvMVq0vgdtmmVkbqbN/ RenVNows2GYsBX9fPjwsB2YVN6FxlQuipSoJz9Wrc2QA8FJy+GCmi4HwVGpKvzM/2a77 lHkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=mngrbj3O73Td/usqkwGD8WcW2Jeb0Ax4KCYtpJilxfA=; fh=tvi3cMg10DBufyqwJNac8JaPayImbGC/wU/sNLMnvaE=; b=tSE7TG0JhN66WqqQwwTkEdtFD5EHdOw4UbVHRBC5/uj6sjZVQFhQo/HAIsYQswnz94 x164WKATwqtKmwKmnuat5+DmwbtAkTmUGVSUjH2mDVYiBVrMC+wYJcb7lLeZV63qFMbg wl65yxbIbgQrMDZYvUT41xwkEXPXWG8AFYvQB6ekM7GKBNfwfHs6Y42aGCBi+1Jn5aH2 k1tpzIw6lt59lUaAbDf6ezo0wF3kmhwk2L495IP81v7ufO5JyiMupxX2EGipoUYLEY/9 3rEuAF8fbhqsedkjEHfUh3dxoqhpRXdsP1595Z0aJYqTUkACz0fe+5e/oSV3mIknJDvY 4k1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=drX9mH6r; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id o15-20020a1709061d4f00b0098859d239dfsi2090645ejh.796.2023.09.14.13.40.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 13:40:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=drX9mH6r; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A3993858C52 for ; Thu, 14 Sep 2023 20:40:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A3993858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694724003; bh=mngrbj3O73Td/usqkwGD8WcW2Jeb0Ax4KCYtpJilxfA=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=drX9mH6r9JsQVcQyy6J33H7kF5N7LJzGgVQqyNIxxfaebdYTlFOqg74MNX//D0hki MC/NNyMfozT89JXcobTzFNvS1TDezRfxKYDQiUTC2/NdHR5w1WelT9rVaih3GtE5o8 oPrgOu1eSrTWMZ0xLp3aZau7P6yv2NjSMu1KwPMo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id A181D3858C52 for ; Thu, 14 Sep 2023 20:39:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A181D3858C52 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-349-G6SRbkIyO1iVDAValYlqjg-1; Thu, 14 Sep 2023 16:39:16 -0400 X-MC-Unique: G6SRbkIyO1iVDAValYlqjg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C7784101A550; Thu, 14 Sep 2023 20:39:15 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.22.10.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B48D40C2070; Thu, 14 Sep 2023 20:39:15 +0000 (UTC) To: Andreas Schwab , gcc-patches@gcc.gnu.org Cc: priour.be@gmail.com, benjamin priour , David Malcolm Subject: [pushed] analyzer: fix missing return in compatible_epath_p Date: Thu, 14 Sep 2023 16:39:14 -0400 Message-Id: <20230914203914.1792717-1-dmalcolm@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: David Malcolm via Gcc-patches From: David Malcolm Reply-To: David Malcolm Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777046918116279618 X-GMAIL-MSGID: 1777046918116279618 On Mon, 2023-09-11 at 10:23 +0200, Andreas Schwab via Gcc-patches wrote: > ../../gcc/analyzer/diagnostic-manager.cc: In function 'bool ana::compatible_epath_p(const exploded_path*, const exploded_path*)': > ../../gcc/analyzer/diagnostic-manager.cc:969:1: warning: control reaches end of non-void function [-Wreturn-type] Sorry about this; should be fixed by the following patch. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-4005-g59f6185b59f711. gcc/analyzer/ChangeLog: * diagnostic-manager.cc (compatible_epath_p): Fix missing return. --- gcc/analyzer/diagnostic-manager.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc index a010f4ba1e1..b3da2a982f2 100644 --- a/gcc/analyzer/diagnostic-manager.cc +++ b/gcc/analyzer/diagnostic-manager.cc @@ -966,6 +966,14 @@ compatible_epath_p (const exploded_path *lhs_path, /* A superedge was found for only one of the two paths. */ return false; } + + /* A superedge was found for only one of the two paths. */ + if (lhs_eedge_idx >= 0 || rhs_eedge_idx >= 0) + return false; + + /* Both paths were drained up entirely. + No discriminant was found. */ + return true; }