From patchwork Thu Aug 25 21:02:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1670389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=) Authentication-Results: legolas.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=IpBJu/Lw; dkim-atps=neutral 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MDFmh2kFDz1ygw for ; Fri, 26 Aug 2022 07:03:14 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DB9A9385277A for ; Thu, 25 Aug 2022 21:03:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB9A9385277A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661461392; bh=vSbyS00bN0Bl5DWfutc1z1JWaXDa2BVS7ST1MSvsRKY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=IpBJu/LwlQNREbZKxTaTADt0AAtyTreqJuPJd6Rxq7w+jbusbZfh+VM/4/7O3f+UQ NwAx1hc6Dg4YMPrQldK2fny541uB2mWmCRsY6dYbcXiPvmP4wYT3zW9IMYy2rz4b1o OBfI1yu+eGerMz+bN6TF+S/vjTR/8Xff17a0JbZI= 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 CE702385F015 for ; Thu, 25 Aug 2022 21:02:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CE702385F015 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-414-IUQxeakENByKj8IzRbqOzw-1; Thu, 25 Aug 2022 17:02:50 -0400 X-MC-Unique: IUQxeakENByKj8IzRbqOzw-1 Received: by mail-qk1-f197.google.com with SMTP id l15-20020a05620a28cf00b006b46997c070so18468761qkp.20 for ; Thu, 25 Aug 2022 14:02:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=vSbyS00bN0Bl5DWfutc1z1JWaXDa2BVS7ST1MSvsRKY=; b=H/zR4jtYpKdnGlY8zUIzyiOZnJl1rZTdFj1UYDxCt0OzmGUgJ3nBYnJvIosul/5LX+ /9d2dE0OjhhnwpH7GVwZlF3ms1c92nyrq2s1t18jBUkrnbSjByd63pmgPza3uKHVLr1M eiF99KBBNqp/BCdp8N+euj3YVigZM3zsf3I/3YMiAtq9e1odW86XroQwE0KGWfZUgdD3 lWg3NpHOkTU1jcZiYnQ3Tsduz4lHoV+Zk678nh2VAoiaAqkIitnNAnzlmjgG2d2tFC5l f7hw//Z5VIa/YKkPXIQRLDkDE0a1yCuX2BRDRcCaOFj8t0VGnpHXEY11/005/9QOdbct iJtg== X-Gm-Message-State: ACgBeo3G/mrmEjqYxWiVkE6duhd1G4z78LNg8QmZrQVJylXBurhBDANk rB6bpnI2M8vmRaKp+aJ/bwgi1ssaHefI2nups1HOE0YKH/t6osdEDxaago8vAS/JqcJkkLwx+kO Ju+x5Pmdv3bYb6Ko2l3ntbixP+LKLxNmtihQnZhpbJJPieN4rSyFQZ/bHa4oASY9QOg== X-Received: by 2002:a0c:c448:0:b0:473:efea:483f with SMTP id t8-20020a0cc448000000b00473efea483fmr5313808qvi.3.1661461370014; Thu, 25 Aug 2022 14:02:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4iPZ59pRTuNAB+9uXtjYYkYeF3s2FW8mHXhJfZnEdhNm1/7qQ525kygkq1J1Fta68Mc947mg== X-Received: by 2002:a0c:c448:0:b0:473:efea:483f with SMTP id t8-20020a0cc448000000b00473efea483fmr5313766qvi.3.1661461369611; Thu, 25 Aug 2022 14:02:49 -0700 (PDT) Received: from barrymore.redhat.com (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id do7-20020a05620a2b0700b006b919c6749esm364995qkb.91.2022.08.25.14.02.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 14:02:49 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [pushed] dwarf2: use DW_ATE_UTF for C++ char8_t Date: Thu, 25 Aug 2022 17:02:47 -0400 Message-Id: <20220825210247.2217333-1-jason@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.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, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" While looking at the Rust changes to dwarf2out I noticed that this was missing from the char8_t support. gcc/ChangeLog: * dwarf2out.cc (base_type_die): Also use DW_ATE_UTF for char8_t. gcc/testsuite/ChangeLog: * g++.dg/debug/dwarf2/utf-1.C: New test. --- gcc/dwarf2out.cc | 1 + gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C base-commit: 585a21bab3ec688c2039bff2922cc372d8558283 diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index e3920c898f5..28a4ae08fe4 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -13210,6 +13210,7 @@ base_type_die (tree type, bool reverse) { const char *name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); if (strcmp (name, "char16_t") == 0 + || strcmp (name, "char8_t") == 0 || strcmp (name, "char32_t") == 0) { encoding = DW_ATE_UTF; diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C new file mode 100644 index 00000000000..43b354f1bb5 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C @@ -0,0 +1,9 @@ +// { dg-do compile { target c++20 } } +// { dg-options { -gdwarf -dA } } + +// Test that all three use DW_ATE_UTF. +// { dg-final { scan-assembler-times {DW_AT_encoding \(0x10\)} 3 } } + +char8_t c8; +char16_t c16; +char32_t c32;