From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id AA9C83858D38 for ; Wed, 10 Jan 2024 11:59:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA9C83858D38 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 AA9C83858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704887994; cv=none; b=YHvOnO+jnxCKafFbcOC7J15no4VHxMh6M0sGv7b3GQdsm/1vJ6nluOMnJIsKWFS1bj5TnBYjh7vi68LKbwWFtd+mTbCX3hAtUJwyjTSpQK2tKL+OYQKI24Vl3iFXrH4xv2QY+cbCx4ZM46UeT3JmVvC6SmOBKBzDj+XYz94f2HU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704887994; c=relaxed/simple; bh=5Gy8PPYM4o38sGh6jHQBBA1TFD7Z+FjMLyCALqzv3Ds=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=qAiX5Z9Dj1Q6LLJA9PXvqfoLzZIj5GTzww51oK+qkfvDt+/75ZQAzYcOfuQ5aiGWPia8/3+u05rAJtnbyEWlxTxI15OZ8ZK7oAXpUy4cUEf1zLhWJaLR9s8bYL3LP1OxPNuZrMPJqeCfdgHABCdlGnQ1croSSFh9SYjBMgSQMTM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2cd7ef70a3bso2077611fa.0 for ; Wed, 10 Jan 2024 03:59:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704887991; x=1705492791; 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=oyMe6340SumwphCR3+38NgKEPXZo+ckU0BeuUnQ7sQA=; b=iCq6+wDOWjC5eTlhWOdrF0FO2QI9qLtIxI8Vt3TQTUIVFf0fu7xp9hOd7GNxPKLIvN yQ0Ns4qqCTO/e+RVv6PAUQMWUn0m9lEZk0YyZdrgOW2/nH8KUgyF5tEtqvGmKzSc0fwh ipogWk9GZVIB4z2TSQ2k+NqyhjaeJianQa1MhuQrnZ/YXLi4bpQ8g+4uNVVIY3t4/sRK vhegmqBj6yIgC13LsospLegNz5EqMkUAjZTr5oEn4sezNlMv7/66ZEHTdgsJNAOHjO7w Z3z5idiuPqXfnEqCOafClZF1eekOb8T1xdV4FmpD8E8b4NuLvUcC8TlSioIwvsQ5tHVK SYyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704887991; x=1705492791; 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=oyMe6340SumwphCR3+38NgKEPXZo+ckU0BeuUnQ7sQA=; b=A5hzPO962mC4FpP4SKsvrRbI6Go8RrHUJurC+nZbpqWmN34w/eC0sj/rnIRUVwtXqG brW5nLubi0TRUfRW3NI5lkWNxM/JGpKM7kAIOYDgplFOzWwT4ncJPET5+sIJsflwiKt5 bVdmSy+iQ7f8UzZFuRL90cyk4JcNLyCx3ua7PpDPZKIS24RJAx7QnobmpZBKGLUXxjK/ MNolyS2Bz9GOT0CQ2B/s83Upg6UY+Cb1Revm9btBV+JoA1wZlmOyIcsFBgkrraHnPXaL ERkXQqhm2PNtTXgrw29rSFc94eQ+7b+rVqBiqcFqbybF1EqHDVmgf+DxrWEeUXzXVFXT 3itA== X-Gm-Message-State: AOJu0YwAzU7jC0DfDeyfpAkF5aZB0JZVpq9z+s4GvW43sZ1GBHZRtFH6 CXK7nTd9sz7f/gQCtTpvACTyQ/8+7dPShyThLKQ= X-Google-Smtp-Source: AGHT+IFpRESt5eSYAT7RhS9uIVQG62UenppIBF/0fLH2txVnaeJzEomLziZAqmcvEy05FkvO08/z8WJ9EDSIqB1fyO8= X-Received: by 2002:a05:651c:1420:b0:2cc:d4f3:aa3d with SMTP id u32-20020a05651c142000b002ccd4f3aa3dmr566453lje.11.1704887990676; Wed, 10 Jan 2024 03:59:50 -0800 (PST) MIME-Version: 1.0 References: <3238326.AJdgDx1Vlc@fomalhaut> <1875304.tdWV9SEqCh@fomalhaut> In-Reply-To: <1875304.tdWV9SEqCh@fomalhaut> From: Richard Biener Date: Wed, 10 Jan 2024 12:54:37 +0100 Message-ID: Subject: Re: [PATCH] Fix debug info for enumeration types with reverse Scalar_Storage_Order To: Eric Botcazou Cc: Tom Tromey , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 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 Wed, Jan 10, 2024 at 12:53=E2=80=AFPM Eric Botcazou wrote: > > > Can you elaborate on the DIE order constraint and why it was chosen? T= hat > > 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_endianity)); + return after_die->die_sib; > > > > ? > > That's preexisting though, see line 13730 where there is a small blurb. > > The crux of the matter is that there is no scalar *_TYPE node with a reve= rse > SSO, so there is nothing to equate with for the DIE carrying DW_AT_endian= ity, > unlike for type variants (the reverse SSO is on the enclosing aggregate t= ype > instead but this does not match the way DWARF describes it). > > Therefore, in order to avoid building a new DIE with DW_AT_endianity each > time, the DIE with DW_AT_endianity is placed right after the naked DIE, s= o > that the lookup done at line 13730 for reverse SSO is immediate. Hmm, I see. The patch is OK then. Thanks, Richard. > > Likewise the extra argument to the functions is odd - is that not avail= able > > on the tree type? > > No, for the reason described above, so the extra parameter is preexisting= for > base_type_die, modified_type_die and add_type_attribute. > > -- > Eric Botcazou > >