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: 771 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp421433wro; Thu, 25 Aug 2022 14:03:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR525xCE/5fOJXQKLPH2xcjAKCWUJkYZtIdy9bVoVDm7sZrQmnziLlQaLqWKhojQ32bNcZXm X-Received: by 2002:a05:6402:1e8f:b0:440:eb20:7a05 with SMTP id f15-20020a0564021e8f00b00440eb207a05mr4430731edf.169.1661461417272; Thu, 25 Aug 2022 14:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661461417; cv=none; d=google.com; s=arc-20160816; b=jTBXGxQ89fLSIWg6G3WaGnbdm+401U6EIlTfmEiZ/pYg7Gqqyv1QTwshOpoFNHYUxr gK/K5R2gRcBEj/SE4wJyv6Oez32wR0eq7rFqa3lRKNdWiVsLScnZKcKWlUKJ1p5CvkAG RNumK5gaBPpelyStWvEOCjjwJkcVkBVMIk4tVRIbj3F+LTllIAUUAAF7aUwsVJ1sYaLN UtFDAxWTM/76jUFs1KW8UoQJVEacC0cDkOxyn4mLkGPCwr25JJfjTBiLY3exobQzrHMy kLYGYbwUmLI4cLkkFXE1EwMpNetyfIGoQu9A9PtD0FeBYfY0rgf2smdXflKUpDkVBdI0 yA+Q== 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:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=vSbyS00bN0Bl5DWfutc1z1JWaXDa2BVS7ST1MSvsRKY=; b=yyW1XJ8m38fqLUN8fwD7w0dwXoWlhxGEC+JH1MPxqMU7WvVDqLCt3L6Njs0SN3evob oD5HcSW0yKrl1TjQq7fEUVlpG2dZfYW7kkzAMIwHCNgCVCxBYT2LhtiWK52xU60iTeC5 /txcZtZAkzD1fthd/sP9pQXNNGEjArTfM8x4jRpNs0Y8BhDB4bDUgiMEjq0NTXRt78BW tiRf+vbXbO51E8UgAOz0tkHKUwe+HCVLpEWKnD3sqSVXx95o7l81xCmEIu6nEyPNfXLI Jl3nd7cr4gsEPLJOuNNT978G0gnoPoU1eeQoOiZs2K8PKfjPHOHiuzv24DkIHArd1GXV VOxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ETN8CQH6; 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 sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cd5-20020a170906b34500b0073da90f1998si90038ejb.943.2022.08.25.14.03.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 14:03:37 -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=ETN8CQH6; 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 2E48C38515D1 for ; Thu, 25 Aug 2022 21:03:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E48C38515D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661461416; bh=vSbyS00bN0Bl5DWfutc1z1JWaXDa2BVS7ST1MSvsRKY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ETN8CQH6fqhbiEf7m+9kyt4xSBkC6T7IQhXkMVa4tPvtWAAW795tFh3j4EQobL8AS 1EcKqfqgiKG56SZMP1v9Ql46YBX2IEUUKnCFzmVf53bmHV7piREDl6tjZfyXDBsq7Y FH3ka11xWJX2n8mpo5lfI1W46MT76T2Qkq9XgMs8= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742168567019549045?= X-GMAIL-MSGID: =?utf-8?q?1742168567019549045?= 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;