From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id E8147385801D for ; Fri, 10 Dec 2021 20:57:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E8147385801D Received: by mail-io1-xd30.google.com with SMTP id p23so11804534iod.7 for ; Fri, 10 Dec 2021 12:57:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=Zq/Qz9iy6F8Hpa1uUKS1ADfu4MorcY+6b8EvzmVJvl8=; b=tvWzHoNiSZ1yuBAm5wUaiveFkARcWaApm6EyXO07TCHcfte+heh68lD31iBHzZUPWD HMQrJmLTK6QOJ9vlN+lfNHzf+3RUVzwNsg5sr7dcZLLFuSoEMkdy7M3Jx49w8LP2JPwR oM7zsSGppPsX+yp5MDgADjCsN+HDVlfRjHUPLxj3zWeltc4f7D8g5HQoCXDTIEuhUDpj rymyEsU7917Yk05gPk9FoU7Cgp8qCdHQD3s8dMdD6whDB17fxiHYc2/j+adzGit3bJ2c h6V4c4VY79KM/SuoAFbr83r3jTAz6WMv4KOFqejWQXoPEmkGm9ZZPI555kSELpx8fpRh M8mg== X-Gm-Message-State: AOAM530RmZpSuXD1lCS4FjcRSgHfaiMF9D6OVnCn8/9yMw6YtEzblZXp k1CuyKpzWBhNYoXo3qbu6T4= X-Google-Smtp-Source: ABdhPJx7/iKuYMxipx/nc/NVRhPVMgQFWSay2jX4ajJ5ZI7NR8pqJgVJaUUeh2dWyglqLqY9I4MMhg== X-Received: by 2002:a05:6602:1604:: with SMTP id x4mr23699098iow.84.1639169871152; Fri, 10 Dec 2021 12:57:51 -0800 (PST) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id m5sm2567380ilg.75.2021.12.10.12.57.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Dec 2021 12:57:50 -0800 (PST) Message-ID: Date: Fri, 10 Dec 2021 13:57:49 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH] gengtype: remove "tree_exp" special attribute Content-Language: en-US To: Patrick Palka , gcc-patches@gcc.gnu.org References: <20211210154101.2898414-1-ppalka@redhat.com> From: Jeff Law In-Reply-To: <20211210154101.2898414-1-ppalka@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Fri, 10 Dec 2021 20:57:53 -0000 On 12/10/2021 8:41 AM, Patrick Palka via Gcc-patches wrote: > The function comment for adjust_field_tree_exp says this special case > is for handling trees whose operands may contain pointers to RTL instead > of to trees. But ever since r0-59671, which fixed/removed the last two > tree codes for which this was possible (GOTO_SUBROUTINE_EXPR and > WITH_CLEANUP_EXPR), this special attribute is largely a no-op. > > This patch removes it and instead just annotates struct tree_exp > with the "length" attribute directly. Not sure it makes a difference, > but I use %h instead of %0 in the "length" attribute to be consistent > with other structures' "length" attributes within tree-core.h. > > This changes the code generated for TS_EXP handling in gt-cp-tree.h from: > > case TS_EXP: > gt_ggc_m_9tree_node ((*x).generic.exp.typed.type); > switch ((int) (TREE_CODE ((tree) &(*x)))) > { > default: > { > size_t i3; > size_t l3 = (size_t)(TREE_OPERAND_LENGTH ((tree) &(*x))); > for (i3 = 0; i3 != l3; i3++) { > gt_ggc_m_9tree_node ((*x).generic.exp.operands[i3]); > } > } > break; > } > break; > > to: > > case TS_EXP: > { > size_t l3 = (size_t)(TREE_OPERAND_LENGTH ((tree)&((*x).generic.exp))); > gt_ggc_m_9tree_node ((*x).generic.exp.typed.type); > { > size_t i3; > for (i3 = 0; i3 != l3; i3++) { > gt_ggc_m_9tree_node ((*x).generic.exp.operands[i3]); > } > } > } > > which seems equivalent and simpler. > > Boostrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? > > gcc/ChangeLog: > > * gengtype.c (adjust_field_tree_exp): Remove. > (adjust_field_type): Don't handle the "tree_exp" special attribute. > * tree-core.h (struct tree_exp): Replace special and desc > attributes with length. Should this wait until stage1 reopens?  It doesn't seem like a bugfix. jeff