From patchwork Thu Mar 17 22:40:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 1606799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=u6Bw7VN5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KKMZm3SGjz9s3q for ; Fri, 18 Mar 2022 09:41:51 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 43703386EC0E for ; Thu, 17 Mar 2022 22:41:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43703386EC0E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1647556909; bh=YR8tHzQXFATQSMhS/T7BYYyoElaZrNsUg2ftzvsW67w=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=u6Bw7VN5kFjkqOH+Ugovomy7lQRZQfjv7nrJuXS2fgy+m8Dy4yKMKO28R8Jn+bw9j zjT2WeZOcmhdU3/Sr3MyNHkjBosWsAOQnbpj8uk/FTEY7vriYUZzhfipryeORhbDFP /aqDulGydxl9h8uclu8G+iypun5lkgwmSpjjvmCk= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 154F93857815 for ; Thu, 17 Mar 2022 22:40:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 154F93857815 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-624-3831u3NHO-2MDny_ByBf5w-1; Thu, 17 Mar 2022 18:40:34 -0400 X-MC-Unique: 3831u3NHO-2MDny_ByBf5w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E773D185A7BA for ; Thu, 17 Mar 2022 22:40:33 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.2.17.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id C702B1400E6F; Thu, 17 Mar 2022 22:40:33 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [committed] analyzer: fixes to -fdump-analyzer-state-purge Date: Thu, 17 Mar 2022 18:40:33 -0400 Message-Id: <20220317224033.4160351-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-7695-g79e210f0c8e1fa gcc/analyzer/ChangeLog: * state-purge.cc (state_purge_annotator::add_node_annotations): Avoid duplicate before-supernode annotations when returning from an interprocedural call. Show after-supernode annotations. Signed-off-by: David Malcolm --- gcc/analyzer/state-purge.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/analyzer/state-purge.cc b/gcc/analyzer/state-purge.cc index e99c9cb593e..c37234ff16a 100644 --- a/gcc/analyzer/state-purge.cc +++ b/gcc/analyzer/state-purge.cc @@ -499,11 +499,12 @@ state_purge_annotator::add_node_annotations (graphviz_out *gv, /* Different in-edges mean different names need purging. Determine which points to dump. */ auto_vec points; - if (n.entry_p ()) + if (n.entry_p () || n.m_returning_call) points.safe_push (function_point::before_supernode (&n, NULL)); else for (auto inedge : n.m_preds) points.safe_push (function_point::before_supernode (&n, inedge)); + points.safe_push (function_point::after_supernode (&n)); for (auto & point : points) {