From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id 77AC83858D38 for ; Wed, 10 Jan 2024 09:42:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 77AC83858D38 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 77AC83858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704879773; cv=none; b=iseaiSAokic+FS2tUtCKNjnqBeB7//4NpysIsByxacR0pZOxsORdGW2MGs7jDpMU3oUtGlZHWTFeEOsSMZB7a0I30Fsve7ylY8TTeBILLas5/TBV/1xX2s3zIszybnnRvvcLPT0qxOKh6uaBzbYSyjEsLTQf0PtZNJ7dnMPTJfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704879773; c=relaxed/simple; bh=5qmE4QQ5Kw8WLeXhevaEtN+c4zoJAsnRbtZppfKp8kI=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Klu2ot7e/vOLNDhabLWJTYc2FYCTi7Yqa04dnJ0iuhoE3LRXXs0s4ZWzODOZafKCHYWRWtXrMMcJBbhtDod80fyLJwW0qNnkd/nqNrOl6Sk1MyefYXxpBMleTucgiV2ERLJmebciew4vY2n7n2ROfvnXUxUmSykPLDf+qVYtYbI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2cd1aeb1bf3so36231691fa.1 for ; Wed, 10 Jan 2024 01:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704879769; x=1705484569; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=49VpS4s738L+BALSaLaEmB5mzfbpMt75x30qMEXIzp4=; b=RrRx6E3/IpA47Ijqq5etBLlfax1qJ24+4bKObzfzB1FqsY2ckDjavZ3n//3p3nf4HY Hrnvse55/rbtbDuhORwaMwgKIClTKN/gxl8UkUrlS/GV05/3mCvL0sTFM1mzqbDZOnGH OFaqfG4YnXkSBinHSvFKf8EPJnRVdXhqpObyg2WLx9L/eRmR5wSom5/ziM2dJ4o51dkA enAYA3zB+gIVtVoiEFKycpgmh1n8skF2qJG7X+0Y/gz6/GlZ5knFwP+RyO82TwTg6K70 REFs2vT747xygunHDundlJglD5OBnqc79O6ZXKWWQMoQU2OOdIWjmz+7MeHP6V7G66xi eZww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704879769; x=1705484569; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=49VpS4s738L+BALSaLaEmB5mzfbpMt75x30qMEXIzp4=; b=X1t8YUbSM2JqvAgD8ieZCVZ1YYympUYOqidz2ucOyvCH4IkcFnf1bubvMD9g7KbpBT A4J2aY5GQVFG8PzKuconPFqFifnupPG3aS6WwRXkdwOBnHnnyIIuOyGnNMdZMJhyOHfW sLu3sd94LnkBxxg2fBJrN8IDC/4C4R13EdmBDiKiLbSTbyh/mvOoQAUOS20tivKWZ/8l 3kybtp2xrS4GoYThfrxaNb0vaPiMIEvJ4RM1eFfSMy97nxJMnqBiyA79gevl38MwQrAL V+ps76lN45fLr4A+nMuomPYQhzbjVXP7WDzz/1zDq+OeKQ2VaBxEyaJYKuriQxC+3unn kv9A== X-Gm-Message-State: AOJu0YwR2X2JJ5BYoVuda9UBhhwPuriUaeHq4vQC2yM7FccYEzF2HgJF PUNnB+EQAF9s6QfPpsPnayc137+LvnYRVlCxFeI= X-Google-Smtp-Source: AGHT+IFj+Da3FIac640pLeiiXpZEc0R2h+C3xQUC5ySIUWwK3SLYek9ElL048OqaTv9w48VZsH1Ahm1/jDig06fFtk8= X-Received: by 2002:a05:651c:793:b0:2cd:200d:e602 with SMTP id g19-20020a05651c079300b002cd200de602mr471527lje.20.1704879768598; Wed, 10 Jan 2024 01:42:48 -0800 (PST) MIME-Version: 1.0 References: <3238326.AJdgDx1Vlc@fomalhaut> In-Reply-To: <3238326.AJdgDx1Vlc@fomalhaut> From: Richard Biener Date: Wed, 10 Jan 2024 10:37:36 +0100 Message-ID: Subject: Re: [PATCH] Fix debug info for enumeration types with reverse Scalar_Storage_Order To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org, Tom Tromey Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On Tue, Jan 9, 2024 at 9:18=E2=80=AFPM Eric Botcazou = wrote: > > Hi, > > this is not really a regression but the patch was written last week and i= s > quite straightforward, so hopefully can nevertheless be OK. It implement= s the > support of DW_AT_endianity for enumeration types because they are scalar = and, > therefore, reverse Scalar_Storage_Order is supported for them, but only w= hen > the -gstrict-dwarf switch is not passed because this is an extension. > > There is an associated GDB patch to be submitted by Tom to grok the new D= WARF. > > Tested on x86-64/Linux, OK for the mainline? It may also help the GDB si= de to > backport it for the upcoming 13.3 release. Can you elaborate on the DIE order constraint and why it was chosen? That = is, + /* The DIE with DW_AT_endianity is placed right after the naked DIE.= */ + if (reverse) + { + gcc_assert (type_die); ... and + /* The DIE with DW_AT_endianity is placed right after the naked DIE.= */ + if (reverse_type) + { + dw_die_ref after_die + =3D modified_type_die (type, cv_quals, false, context_die); + gen_type_die (type, context_die, true); + gcc_assert (after_die->die_sib + && get_AT_unsigned (after_die->die_sib, DW_AT_endiani= ty)); + return after_die->die_sib; ? Likewise the extra argument to the functions is odd - is that not available on the tree type? Richard. > > 2024-01-09 Eric Botcazou > > * dwarf2out.cc (modified_type_die): Extend the support of reverse > storage order to enumeration types if -gstrict-dwarf is not passe= d. > (gen_enumeration_type_die): Add REVERSE parameter and generate th= e > DIE immediately after the existing one if it is true. > (gen_tagged_type_die): Add REVERSE parameter and pass it in the > call to gen_enumeration_type_die. > (gen_type_die_with_usage): Add REVERSE parameter and pass it in t= he > first recursive call as well as the call to gen_tagged_type_die. > (gen_type_die): Add REVERSE parameter and pass it in the call to > gen_type_die_with_usage. > > -- > Eric Botcazou