From patchwork Thu Sep 14 06:41:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 139349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp152925vqi; Wed, 13 Sep 2023 23:42:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGV/81UGLKNAZ07KgVIlpGd12t7TIiF0jn7EiOsFX5R0tnklu5L7LEmQPMOueL97UGl2H2d X-Received: by 2002:a05:6402:51a:b0:52b:db31:3c5c with SMTP id m26-20020a056402051a00b0052bdb313c5cmr4216445edv.0.1694673727415; Wed, 13 Sep 2023 23:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694673727; cv=none; d=google.com; s=arc-20160816; b=zt0O6/uyYR7G0r8gvVCA5Yd3s8keLOYsI9LN9Kv5ZxQKp0+eHFuuw2fIL2x26esHv/ kgGAhwIeBKkAQRGRpfcH2BZjSxvYxqBCvVW2ZaT9UB3/NngxCdzEmBEG62HpnRai9qcD oappx0Kumf+LvWDJBdQzaidSlacuh7OtBPB5QLOY3ByUupNm/V0Ol48xXt/BeSnJPDMW enSF37l32iQIyf+P52cAow+YYdWoiIUhNu7IlvFAUhtN5rfTW5MtMo50CPEmqdet9qc0 XNA9pnusyytq1N1DlxAXNpdJGM3OrDc6vLhh2qhmCderqMXG+lgrvkzf4s0dT0+wkA59 T7JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :dmarc-filter:delivered-to; bh=fWcQSb0Ownw4BKvHu4e4xZaAVF9Z4YOUck2CrfOX9vQ=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=qVnuc+xbzFb7kbUyA7E3aRwyvXkjb7hhdDfsssWjT1Cjx9KPSe6SlRtU6OHPnogc3H 0LypLjyQ+j9C+Vg4br4aWSu8fvEyarO1Pa6kOI2yTbU6F5PC6RxiAmNtYjYXVIzzYbQV C8GzGMwYMOnZhX4wwJzXJ0dWfL6Do7+q+aOXxiLgcSHUhciYaQlxmlY5cairvN54Cm/S VDVqmQq0GGE89513y5u5OJooT6iLjau2eMTrqO8ri2V6f4Tkb4txLArVxneeur3/Y+HL xCPcutg1IA4FQovd0fqItsN/utgLOs+PN3GH2N9XK/GjdUGAgrDQb7PLpsfUS9f9hx8R SRAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@osandov-com.20230601.gappssmtp.com header.s=20230601 header.b=SA1HIN3W; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d13-20020a056402516d00b005236af6ada4si767219ede.34.2023.09.13.23.42.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 23:42:07 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@osandov-com.20230601.gappssmtp.com header.s=20230601 header.b=SA1HIN3W; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 99B4C3858C2F for ; Thu, 14 Sep 2023 06:42:05 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id C8AD23858D20 for ; Thu, 14 Sep 2023 06:41:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8AD23858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=osandov.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=osandov.com Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-68fc9a4ebe9so515531b3a.2 for ; Wed, 13 Sep 2023 23:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20230601.gappssmtp.com; s=20230601; t=1694673693; x=1695278493; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=fWcQSb0Ownw4BKvHu4e4xZaAVF9Z4YOUck2CrfOX9vQ=; b=SA1HIN3WhlCWYQ0b+fWjQcOHkKatUAFDpE8i4YmbGhFS5bS7W+N8DX+Bs0jfr0yQ7T 77q8fjDrzrMoqXm4XFkXV7wh1yfUDSMY0sbchg4HPTM9ujF2KGl1TN1DiBxiMuZnLjuE Aw0Zj2CoaNOy3rOqhWlDbUNfolBn0EoZ/8mB16MBgRTxrT3vYmgjRHETYFLoiMHHXVLw ZJn3TKfSrdXzGHYwHJd64Udi0zcUiZkFjGlMvZEoV7WJQllLWXXieF8Mg+QgQvaF50lr +hQCCPGE1sZGUSDIWnGNuIfXa3vcSKv43X9n9GiH3/AxZpibrWntut3jcVkivHGO1teo OHyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694673693; x=1695278493; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fWcQSb0Ownw4BKvHu4e4xZaAVF9Z4YOUck2CrfOX9vQ=; b=SbVkP7+s9lN6BcmoRv4963+57fn8vBJAKP/SObvN6iSMppnXuzTjYwPbn1gDAs9PrQ JzfLzj333uiBFMmIKhTPtkwBnmMGOTXJRzmqUyP1kRXpjxYdrGGMstQ13SE1a0IpLhXJ R9McxoyoRI/T2Owhv6U6bbTLvsISFDJ5ap43V50goFhN7YmoU9sdYMZJc/mEl+gcLhZk TWNuL78mXyugsp3KbQIo1nW0eXN2KM482Fsj/ld5nd8Eh0cvRCUNRaRNSGpBmPklvUi8 +hud9WVPznor1LLoZNl445hFPs5Kwe273+hh677243i2qx3QYwSa3pNvJ5DlsTXvvxxc VaZg== X-Gm-Message-State: AOJu0YxrDAGOIkLzXgC20qL1VL3b/KG381gQoZcOZumJ2GdxKqritahU cMMQ6tJkRb3VWEoJTrMU50P/bXrsVGJoah7/12LXZQ== X-Received: by 2002:a05:6a00:440b:b0:690:33d6:11e7 with SMTP id br11-20020a056a00440b00b0069033d611e7mr324492pfb.12.1694673692943; Wed, 13 Sep 2023 23:41:32 -0700 (PDT) Received: from telecaster.hsd1.wa.comcast.net ([2601:602:a300:3bc0::2928]) by smtp.gmail.com with ESMTPSA id x5-20020a63aa45000000b0056afdbd0a24sm513194pgo.9.2023.09.13.23.41.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 23:41:32 -0700 (PDT) From: Omar Sandoval To: gcc-patches@gcc.gnu.org Subject: [PATCH] debug/111409 - don't generate COMDAT macro sections for split DWARF Date: Wed, 13 Sep 2023 23:41:22 -0700 Message-ID: <28b5f064b4f94531489383fa6a9979c4e1484aef.1694673609.git.osandov@osandov.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776994197945009405 X-GMAIL-MSGID: 1776994197945009405 Split DWARF files aren't processed by the linker, so DW_MACRO_import offsets aren't relocated and the .debug_macro.dwo sections aren't deduplicated and merged. There's no clear way for this to work for split DWARF, so disable it. gcc/ChangeLog: PR debug/111409 * dwarf2out.cc (output_macinfo): Don't call optimize_macinfo_range if dwarf_split_debug_info. gcc/testsuite/ChangeLog: PR debug/111409 * gcc.dg/pr111409.c: New test. --- gcc/ChangeLog | 6 ++++++ gcc/dwarf2out.cc | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr111409.c | 7 +++++++ 4 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr111409.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b69160b025d..2b0ff902f55 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2023-09-13 Omar Sandoval + + PR debug/111409 + * dwarf2out.cc (output_macinfo): Don't call optimize_macinfo_range if + dwarf_split_debug_info. + 2023-09-12 Juzhe-Zhong PR target/111337 diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index c4a935d5101..f60a0656d8f 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -29247,6 +29247,7 @@ output_macinfo (const char *debug_line_label, bool early_lto_debug) case DW_MACINFO_define: case DW_MACINFO_undef: if ((!dwarf_strict || dwarf_version >= 5) + && !dwarf_split_debug_info && HAVE_COMDAT_GROUP && vec_safe_length (files) != 1 && i > 0 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index de0eadc31d7..3534e203a8a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2023-09-13 Omar Sandoval + + PR debug/111409 + * gcc.dg/pr111409.c: New test. + 2023-09-12 Juzhe-Zhong * lib/target-supports.exp: Enable vect_int for RVV. diff --git a/gcc/testsuite/gcc.dg/pr111409.c b/gcc/testsuite/gcc.dg/pr111409.c new file mode 100644 index 00000000000..1a79d81444e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr111409.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-skip-if "split DWARF unsupported" { *-*-darwin* } } */ +/* { dg-options "-gsplit-dwarf -g3 -dA" } */ +/* { dg-final { scan-assembler-times {.section\s+.debug_macro} 1 } } */ +/* { dg-final { scan-assembler-not {.byte\s+0x7\s*#\s*Import} } } */ + +#define foo 1