From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 98A633858D38 for ; Sun, 22 Jan 2023 18:49:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 98A633858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x632.google.com with SMTP id z20so7515946plc.2 for ; Sun, 22 Jan 2023 10:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mGTI8f4JyQTAvKsLbjUPX9uUDUWzn91cDrvaLbdSzgI=; b=KQi6n74azK4N7XVkZScj7Jx3UbA+a3BPo4HPWEYSf8Cn1fYbFtW3fhvO53EnUfSLbK 4rD5HjbrkWStE6yEGgFeZzm6/tmOLpdIh+3FCOYv2JID8m/tpNOOcz3PPNVL/u1JBbX+ sedgnKLswooQCtBqPZ+u5Sh8H1qBpoyXQkU07hb3WVSSCL1d+gV7DseyftdLlsQyYGdF 6Dxre7qN8C4ymDlm1/VpIj3HimVVGzoizmGCtIeQNcSFj9F9+TOg9/fBkIEdM6mqqDUD fgpNp02kcJX273HHgLDk0Sm2iJPSMidLJ2VZxUWuhp6dbP1UN2CBLv/E+9U7JgJ36/xD Q8cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mGTI8f4JyQTAvKsLbjUPX9uUDUWzn91cDrvaLbdSzgI=; b=TzjTYZrJ5QACp7rVzEPy3PknlQQFetcVa8Lt8HsXwEmTpAhbT3KKHwQWkzn+sL4zH1 OVwiHAiiZtGHdDA9Mh+Lcv3zLHjrznToZibUeRQ/5LX4iHgaEUhylPtS1SHANNs/neni +TJ9Qx1k91zRB8Z4cWlnKQBX+cO6mmt/D1FjYKPmc5dyTQ2w98b8pVtb0sfdx+zg5WOg 7PWpPp1rFka45TlUR9/NO3NOZNDyJRRH2jjByr9sLFX59l21Ev4gAokym9qdqKjyWTvv 5c99oidEext06mbz8ImbM9AoInLNcxkZ7zAewAR2KgqrC/uS0L98YiDlJS37LQFCIvXd 9Sew== X-Gm-Message-State: AFqh2kq3X3UA/cqUvZBoCArKG2ierD6DRi0yimKoPfaBfNravFCXnKRu T55v/uUkB6Z0Myj93qigaZk= X-Google-Smtp-Source: AMrXdXv25Sp6Uoym4sNdFaw0C/XUgEzWM1bnlGLLOqjKe85VI8yd3nWeC/LM/ERuF6w4awu+Fm6qtw== X-Received: by 2002:a17:902:e214:b0:194:7c95:dc64 with SMTP id u20-20020a170902e21400b001947c95dc64mr20306315plb.7.1674413384536; Sun, 22 Jan 2023 10:49:44 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id ik4-20020a170902ab0400b001925d6fdfebsm21798667plb.299.2023.01.22.10.49.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Jan 2023 10:49:44 -0800 (PST) Message-ID: Date: Sun, 22 Jan 2023 11:49:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH 1/2] select .rodata for const volatile variables. Content-Language: en-US To: Richard Biener Cc: Cupertino Miranda , gcc-patches@gcc.gnu.org, jose.marchesi@oracle.com References: <20221202175225.2780-1-cupertino.miranda@oracle.com> <20221202175225.2780-2-cupertino.miranda@oracle.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/9/23 00:57, Richard Biener wrote: > On Mon, Dec 5, 2022 at 7:07 PM Jeff Law via Gcc-patches > wrote: >> >> >> >> On 12/2/22 10:52, Cupertino Miranda via Gcc-patches wrote: >>> Changed target code to select .rodata section for 'const volatile' >>> defined variables. >>> This change is in the context of the bugzilla #170181. >>> >>> gcc/ChangeLog: >>> >>> v850.c(v850_select_section): Changed function. >> I'm not sure this is safe/correct. ISTM that you need to look at the >> underlying TREE_TYPE to check for const-volatile rather than >> TREE_SIDE_EFFECTS. > > Just to quote tree.h: > > /* In any expression, decl, or constant, nonzero means it has side effects or > reevaluation of the whole expression could produce a different value. > This is set if any subexpression is a function call, a side effect or a > reference to a volatile variable. In a ..._DECL, this is set only if the > declaration said `volatile'. This will never be set for a constant. */ > #define TREE_SIDE_EFFECTS(NODE) \ > (NON_TYPE_CHECK (NODE)->base.side_effects_flag) > > so if exp is a decl then that's the volatile check. Ah, then we can just use TREE_SIDE_EFFECTS for testing if a _DECL node is volatile. So that concern is a non-issue. I think that was the only concern with patch #1. I'll install it momentarily. Jeff