From patchwork Sun Nov 3 22:22:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lewis Hyatt X-Patchwork-Id: 2005820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=IZS7VLu/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XhTfM06cKz1xxN for ; Mon, 4 Nov 2024 09:24:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3CA7C3857000 for ; Sun, 3 Nov 2024 22:24:09 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by sourceware.org (Postfix) with ESMTPS id 53EE1385841D for ; Sun, 3 Nov 2024 22:22:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 53EE1385841D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 53EE1385841D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::f32 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730672580; cv=none; b=gfmqSKw4m9iEjH3b60UDhOCwmR4nrCd46D6aSnbJFr8JCoLqW+QDcD3kn3z7K6XtXmEWbBVZO4IGHxCm81Eu6lE+cYYHE+aawCiga+Nt9yLl3xQT6jSRr/8p+EuES5M1Z2b8+R1oGZ7q7W2slyvqc6ooLQWVs/BR+tleCibwwC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730672580; c=relaxed/simple; bh=HSoCJPiz9Vt8lgTOunG0o3wlhVT1N2NaceS429IicNA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=KsoGbt2qF0DjDiwZWs7AwgFghGEx28rHTdVHwmgTgJzJLBw2m3yXMZH7GhT9yUr7cSxzONCu7KzvfcaoDWOPn2k5zwQWGCJ8zwMc0zTIKNvUo3NEOC6YPiT9eG4h8lpr9P/gyyOSUSzRFvOkmxizLpRyAd8ZSGK0VeS8NCQOim8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6cbe3e99680so20730946d6.3 for ; Sun, 03 Nov 2024 14:22:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730672571; x=1731277371; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A8XE3yt/EZII79g4rt0VsO894nr+xhphYsgHew1XD08=; b=IZS7VLu/Qd3pe0BbmAiew8AaHQCwhRL4pt1afbIK2USI19dnJxp5GIU8y1TOZ9FTFa mFAu9x+ihhcqxY8oGKLrq2yw2d8vvgr0idKjqFDjo+o48tNPuhL0MYIbudQCFijKQmrw 95RxTc9dTNa30kp4AL370aXL3X1vE0U0r/7Ui25fli1gucB+k0L7H0Ox8Jtf7uP3ABzQ WA5w5Doq2XhQsM/roR0xNuSsgOB7IBRkLAKq4mujeUjVKiHP7ePioZ3W0sctUoyVYZmX 3WBBXerFjv3bxu9uwbd/m40iWWcpk2NBgole8UQYjcJPJPpl7rkg5A6Ja/vPFCXK9Lzi +ndg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730672571; x=1731277371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A8XE3yt/EZII79g4rt0VsO894nr+xhphYsgHew1XD08=; b=C2+ZtkRAQFJPUbN9ZBizQsMUBkUMwMC0ocwhugDDr86Miq7AMRokgNTCSzYIYy7Hcn CHvY0LAin4qerH2NMbVBQzAfEu8aN49rMcBJV9BYLwKDb/CZCRNqgXOqqZ9c+OguO+6m 2h0ct4ebGrth8k7ZFh0jBVwL+BZnyflcIKufvLv/1LYR0Qo9Fa47KFhDMZbkUzdaogmv SF2azn5mTtLydVfodL0zFj/yTH+gEN6M4QO9J5fqLcLKdHphUjlhNsO5al0mZmacq3z0 yONgEILOViAZi03OYIl8+sM6DI3LK4Be2P750hsGTxmHjyx87YuzxTkKdjq+oUTZMWJv VdQw== X-Gm-Message-State: AOJu0YxkC7zTWzd/0wc9neleodKWhcxeHp+MAuNVIhOPJj83V4QwNkUZ pE/WyVMy4aW0iGmi9XQPUh05wm1uXZLgtTa5Q63hWF6+bch6OuVuLdPYnA== X-Google-Smtp-Source: AGHT+IEpcVRZUQv6qAyTN4VDmvdxtpL0uoNbnU5Ovt7RvibjuR6X46QsGRnI9TiWYLI8V1GYL1tnjA== X-Received: by 2002:a05:6214:4a05:b0:6cb:f075:57da with SMTP id 6a1803df08f44-6d185674354mr491769576d6.7.1730672571536; Sun, 03 Nov 2024 14:22:51 -0800 (PST) Received: from localhost.localdomain ([173.54.240.58]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d35415b2fesm42025866d6.92.2024.11.03.14.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2024 14:22:50 -0800 (PST) From: Lewis Hyatt To: gcc-patches@gcc.gnu.org Cc: Lewis Hyatt Subject: [PATCH 08/15] Support for 64-bit location_t: Analyzer parts Date: Sun, 3 Nov 2024 17:22:13 -0500 Message-Id: <20241103222220.933471-9-lhyatt@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241103222220.933471-1-lhyatt@gmail.com> References: <20241103222220.933471-1-lhyatt@gmail.com> MIME-Version: 1.0 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: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org The analyzer occasionally prints internal location_t values for debugging; adjust those parts so they will work if location_t is 64-bit. For simplicity, to avoid hassling with the printf format string, just convert to (unsigned long long) in either case. gcc/analyzer/ChangeLog: * checker-event.cc (checker_event::dump): Support printing either 32- or 64-bit location_t values. * checker-path.cc (checker_path::inject_any_inlined_call_events): Likewise. --- gcc/analyzer/checker-event.cc | 4 ++-- gcc/analyzer/checker-path.cc | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/analyzer/checker-event.cc b/gcc/analyzer/checker-event.cc index 5a292377e93..bb26f71e4b4 100644 --- a/gcc/analyzer/checker-event.cc +++ b/gcc/analyzer/checker-event.cc @@ -188,8 +188,8 @@ checker_event::dump (pretty_printer *pp) const if (m_effective_fndecl != m_original_fndecl) pp_printf (pp, " corrected from %qE", m_original_fndecl); } - pp_printf (pp, ", m_loc=%x)", - get_location ()); + pp_printf (pp, ", m_loc=%llx)", + (unsigned long long) get_location ()); } /* Dump this event to stderr (for debugging/logging purposes). */ diff --git a/gcc/analyzer/checker-path.cc b/gcc/analyzer/checker-path.cc index 98b59884174..25d95fe0bfc 100644 --- a/gcc/analyzer/checker-path.cc +++ b/gcc/analyzer/checker-path.cc @@ -281,8 +281,9 @@ checker_path::inject_any_inlined_call_events (logger *logger) logger->log_partial (" %qE", iter.get_block ()); if (!flag_dump_noaddr) logger->log_partial (" (%p)", iter.get_block ()); - logger->log_partial (", fndecl: %qE, callsite: 0x%x", - iter.get_fndecl (), iter.get_callsite ()); + logger->log_partial (", fndecl: %qE, callsite: 0x%llx", + iter.get_fndecl (), + (unsigned long long) iter.get_callsite ()); if (iter.get_callsite ()) dump_location (logger->get_printer (), iter.get_callsite ()); logger->end_log_line ();