From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id DftHDQg4ampHcjMAWB0awg (envelope-from ) for ; Wed, 29 Jul 2026 13:27:36 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EAc1Pku+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 241051E09E; Wed, 29 Jul 2026 13:27:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id DBDEA1E099 for ; Wed, 29 Jul 2026 13:27:34 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E65024BB58F8 for ; Wed, 29 Jul 2026 17:27:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E65024BB58F8 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EAc1Pku+ Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 007C94BB5899 for ; Wed, 29 Jul 2026 17:27:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 007C94BB5899 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 007C94BB5899 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785346029; cv=none; b=lMm5VTOKpVMPiboJfPzjQxj5yaRG7cZXqIaoR7bMlJEfqQWR8rUBgqMnEiGx/hxdQ7QmrAQuWSQklVZyNRtTv/03bqFgdd8DGU3yQdFXS2kq9st93G9JhFlTA2+KjfxffVa8p6VgikLXbaBeZ0kzFJWjrpS7ptajuTNT3SPAuXs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785346029; c=relaxed/simple; bh=hD4Mdgid8TDikctH9tLaf5cfRE2SwNz9ONVzApoQMPU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=TRWv2TVDmifqMEhb4NY1znQRxXLJYiCiok85/qHqmTf7rtzm6ul34DAwNw3hc4ZBI2KHd4K8rEvoXvgODqIbLt3yAd+3pgtMIDVYm6kCqN9sHa2O73gi/tRtlfAMw3FQcCtm+uzo+j3+3/3pfBawtGTrXVJLdDFZA9ZJZfaxHxc= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EAc1Pku+ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 007C94BB5899 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785346028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AIWBqLT/+iwsp2w2UPzIWY2Pq2Chya2MY0s7tvRu5LE=; b=EAc1Pku+wf4Y4rMc4dAYIsCU/QqNO7qgNK15snAX0SffvhQI4dx/VB8pg8d0pBUZ9RuMhq DPfeFnB4E002EC1huaz9ugVJyWxgOwp2XM9Q4ylEtZPzmjCA07Gn4NEc1qg+LpZtBeIxQu /6Q4Bk5tZeAyEZdeUxSnmj6kSxTj214= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-478-D7KNUQl0Obysr8AAuZK5jA-1; Wed, 29 Jul 2026 13:27:06 -0400 X-MC-Unique: D7KNUQl0Obysr8AAuZK5jA-1 X-Mimecast-MFC-AGG-ID: D7KNUQl0Obysr8AAuZK5jA_1785346026 Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2cc88e22f92so27892755ad.1 for ; Wed, 29 Jul 2026 10:27:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785346025; x=1785950825; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=AIWBqLT/+iwsp2w2UPzIWY2Pq2Chya2MY0s7tvRu5LE=; b=U1oz4+Cq2JIfj4mVrhQRcQXE3ZFDkKr6ocqur8OvScqj7HKF+Pf1LKsYOKZfWEOlaC 8fEcHLL6X2eLaK2Az4SfqwO3on9GEd9ELDJzr4WPyd07tZ6z5UnkQP9LaTZQjO/ZxjFy ENHEEKyRNJBsk564fiBA2le3kBuBQDQpTHjJduKccpzDtkhg5tOq0unuxtVH5mYmaZQT AmuDdyCu+GktUvcP066yuxpLq436DWQKwq8WqZylpfkWI4wj7SGSrN+NlEAgvANcR8HU lOvrz0MWGInBUozmZFLrASbCWpkJ0qXBTr0ugUTsNeLksemyro+p2fyCpaEzoY2pKDwz TLKA== X-Forwarded-Encrypted: i=1; AHgh+RrjUKAe1s3JvvXkptlGsscKE+voTUX38tMY+ymboUq7Cz3b8WLH7LoX2DQk5TdY+JJeTShUD5MajUnWcQ==@sourceware.org X-Gm-Message-State: AOJu0YzvRYIGhmQ22XU1Fut2nPFjMYMuRqfamm0rUXt5bxMXV5qCu/BG ZghN3CNKn90C1AYC4RjXfOegoDQ/3DTL2tmNqncXlhpuI7RFyi0Mw6ZCVa9hsAmEYaB+mKutTA+ Sbh/wgUpPpFgf/VPj/GjFmdT8rt73QxSUErqepqaqUzf4UBZBgpkbCYUrfFyejhEIzPdSFds= X-Gm-Gg: AR+sD12YCda4piVTAV6NnOJ55Tlifiu4S3vvJOv5aP/rUVs+oeE2dfjy0gkCe+YAajU IHyNCtgZ5flmPAH2uJkOAN6JQuvDaJFP1FWEcg4gAo454oYmrAvARoyrMjpZ7tLO5uGAA0dq9jh E4Y61cYVE6d9mWWjJyFGCSgBD2YqdR+nNRqW79MYIjRxzd98XJgyiS5wbowEGm0OqtOTTwZn3oK 7BUnuj5aDGDKrukocVJRkCSe4y58zQhAkQv+dEWEQJsYTn6kXtaRCgx7Q56HmShTQSisaqKiVBI usl+bqzk5zJg7uqyxLfR1D+2+DLgCWUEDY980dWgYY7W+Yi/8XZyz6ieobTVK73UxI8/1DDcl0d AQGtIP+E= X-Received: by 2002:a17:902:e5c1:b0:2cc:d807:369c with SMTP id d9443c01a7336-2d015edb9a3mr90329015ad.45.1785346025591; Wed, 29 Jul 2026 10:27:05 -0700 (PDT) X-Received: by 2002:a17:902:e5c1:b0:2cc:d807:369c with SMTP id d9443c01a7336-2d015edb9a3mr90328755ad.45.1785346025147; Wed, 29 Jul 2026 10:27:05 -0700 (PDT) Received: from [150.1.200.157] ([172.56.105.224]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d022bc9fddsm14478785ad.40.2026.07.29.10.27.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jul 2026 10:27:04 -0700 (PDT) Message-ID: Date: Wed, 29 Jul 2026 10:27:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] gdb: simplify code in check_typedef To: Tankut Baris Aktemur , gdb-patches@sourceware.org Cc: tom@tromey.com References: <20260727092001.1683349-1-tankutbaris.aktemur@amd.com> From: Keith Seitz In-Reply-To: <20260727092001.1683349-1-tankutbaris.aktemur@amd.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: iRxTe947_Xlt7HWKYlc3WdXN-e_o1OxcRhHpVx2eyOE_1785346026 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hi, On 7/27/26 2:20 AM, Tankut Baris Aktemur wrote: > Simplify a code portion in check_typedef where the conditions are > unnecessary. Also remove the comment that says "treat address spaces > and address classes separately", because since the commit 92fdad7 > "gdb: convert type instance flags to bitfields", they are separate > fields; so, the comment does not look useful. Thank you for the quick turnaround for such a, well, minor corner case. It is very appreciated. One concern I still have (maybe this is no longer an issue?): the old logic (and the remaining comment in check_typedef) is outer-wins on conflict, otherwise inherit from the inner typedef. Always clearing the RHS and having `merge` never take aspace/class from it fixes the outer-qualified case, but drops an aspace that appears only on an inner typedef. How about encoding outer-wins in `merge` instead, and dropping the clearing in check_typedef? That would preserve the previous behavior (and match the comment). For example: type_instance_flags::merge: if (harvard_aspace == HARVARD_ASPACE_NONE) harvard_aspace = other.harvard_aspace; if (address_class == 0) address_class = other.address_class; and check_typedef: instance_flags.merge (type->instance_flags ()); I completely agree with the naming change to `merge'. That is certainly clearer for me. Thanks, Keith