From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 40279385735A for ; Sun, 30 Oct 2022 17:25:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 40279385735A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667150752; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=JJx3qbiuqoPeuiqSq1Yl4bqdBB5uIsCiBPigVSc519I=; b=d4eVSloaOgibWvvdmryG/fcmUaEs6PEOWD7eXU6RPJENLbs2ABvi2vvtow3+8fqC4kfvy9 SBHlitvNE8SgUcnZ8H8SfsXxnrdGDsL+j04A3VLRYgFM/vmLJ2OsGLkqvFJ/0+F9nshpBB SMGIFYXuWUXiqEQ4TKP3OfSyVGBKC3w= 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-411-Da9lWJUqP1i0imdXBfL_vQ-1; Sun, 30 Oct 2022 13:25:49 -0400 X-MC-Unique: Da9lWJUqP1i0imdXBfL_vQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F3424858F13; Sun, 30 Oct 2022 17:25:48 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A817F1121314; Sun, 30 Oct 2022 17:25:48 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 29UHPjCG2302590 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 30 Oct 2022 18:25:45 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 29UHPcL12302589; Sun, 30 Oct 2022 18:25:38 +0100 Date: Sun, 30 Oct 2022 18:25:33 +0100 From: Jakub Jelinek To: Mark Wielaard Cc: arthur.cohen@embecosm.com, Jason Merrill , Tom Tromey , gcc-patches@gcc.gnu.org, gcc-rust@gcc.gnu.org Subject: Re: [PATCH Rust front-end v3 01/46] Use DW_ATE_UTF for the Rust 'char' type Message-ID: Reply-To: Jakub Jelinek References: <20221026081811.602573-1-arthur.cohen@embecosm.com> <20221026081811.602573-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 List-Id: On Sun, Oct 30, 2022 at 04:22:34PM +0100, Mark Wielaard wrote: > Hi, > > On Wed, Oct 26, 2022 at 10:39:09AM +0200, Jakub Jelinek wrote: > > I must say I don't understand nor like this DW_LANG_Rust_old stuff at all. > > Other languages don't do similar dances. > > Look for D, or Go. Neither of them has any non-standard lang code as > > fallback, they use the DWARF assigned DW_LANG_* code, and DW_LANG_C as > > fallback. On most arches, DWARF 5 is the default anyway, or non-strict > > DWARF at least. Where neither is enabled because of prehistoric or buggy > > DWARF consumers, it is unlikely they'd handle Rust sanely anyway. > > Just follow what Go does in the same function. > > DW_LANG_Rust_old was used by old rustc compilers <= 2016 before DWARF5 > assigned an official number. It might be recognized by some > debuggers. But I agree that these days it doesn't really make sense to > emit it. When producing strict DWARF it is also slightly odd to emit a > non-standard language code. So I agree that it makes sense to do what > Go does, always emit DW_LANG_Rust unless we emit strict DWARF for > versions before 5 (and then just fall back to DW_LANG_C). > > The attached patch (against "upstream gccrs") does that. I kept the > oldlang.rs testcase just to see that the -gstrict-dwarf -gdwarf-3 case > does something sane. > > The only "issue" is that is_rust () depends on the comp_unit_die > DW_AT_language being DW_LANG_Rust. But the only usage of is_rust > already depends on strict DWARF. > > https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=no-Rust-old > if someone wants to push that, to merge for a v4. LGTM, thanks. Jakub