From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id CE8FF3945C27 for ; Mon, 5 Dec 2022 18:06:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CE8FF3945C27 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-pf1-x42a.google.com with SMTP id k79so12166825pfd.7 for ; Mon, 05 Dec 2022 10:06:50 -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=UFsOSrJ6pAY+7TjmylJKCEswvmSFV669wTsxyh8UoT8=; b=ZPoJmiiTea0v0GNJ0W5879QJCITzqoVTmfSBJS9Jzir3WVxEizyxctRM6UUOT+NtJS msPQMlSXui6Wze/kEaHE7O1T5GY0lNQHTpmbKzxZVor/y6zIF1ORdFB+kOcKrG9KYyg0 DQCFsbPxKQcxIpv1g8o/uF3ahp4C5IW1Ah4siERs5RVKk1O/FNQEpNxeOK116IXLd5cg VAmj9rZ9TyWstr4rcDsSdJVIRE3M7HAJP1yKHkFt3bUJ/1aNJoU1ZjddbCqqLFdqlAAn c618KZfDPaRqtbco3JahPQABLAHDSB10c9xfkO1PPCuSXw4w/f4JcRUjzlx8GZm9QNae W7Ig== 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=UFsOSrJ6pAY+7TjmylJKCEswvmSFV669wTsxyh8UoT8=; b=b8Yj9WC+Oz4tpjmglAcWapWBTL5f/tIliCF19T7h5oes8zLZ6hl/R50/nfQLFzTmck ng7oXQdf0w5lJ6kabfumAaLRz1hfxabcHCZSL6vzZhGHnzSh67azcwovsXeY9dMK9og7 RvVxQGHR8ig17zKx5COv3YoVOqHwNdsL6AIWDjgtLHJNiK5/Ng+lrU5DO3t6fMxwOimP arxDod28F3fBZ/TG4srDG/JDo8FLOT4dNmg8307XRVT3NT31H3cWguXufYWjIAEL/3KX axLOK+/Dsgc8AQtFnPJHyuQSRpNcbtUD2mTPs+T9LBOsOjAjgBvnNbNiovOikXiIkQ+o VYyQ== X-Gm-Message-State: ANoB5pkmukDE5SuOQRLdXD++HuBaNmdxejTfYKB7d7OXLULBdUXLPtoj nCWAj6ZdzC19BvrEgoETG8uUBSEqNNQ= X-Google-Smtp-Source: AA0mqf7CNzZY0lShKdnIyPcHLsRRqGS7gQeIDx8XNQZn8p+lh1ZQJXmV5mEH+JSancsUBBeOpuqmcA== X-Received: by 2002:a63:e4f:0:b0:478:c343:11ec with SMTP id 15-20020a630e4f000000b00478c34311ecmr4157562pgo.179.1670263609619; Mon, 05 Dec 2022 10:06:49 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id q42-20020a17090a1b2d00b00219752c8ea5sm7850373pjq.37.2022.12.05.10.06.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 10:06:49 -0800 (PST) Message-ID: Date: Mon, 5 Dec 2022 11:06:47 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH 1/2] select .rodata for const volatile variables. Content-Language: en-US To: Cupertino Miranda , gcc-patches@gcc.gnu.org Cc: 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: <20221202175225.2780-2-cupertino.miranda@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,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 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. Of secondary importance is the ChangeLog. Just saying "Changed function" provides no real information. Something like this would be better: * config/v850/v850.c (v850_select_section): Put const volatile objects into read-only sections. Jeff > --- > gcc/config/v850/v850.cc | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/gcc/config/v850/v850.cc b/gcc/config/v850/v850.cc > index c7d432990ab..e66893fede4 100644 > --- a/gcc/config/v850/v850.cc > +++ b/gcc/config/v850/v850.cc > @@ -2865,7 +2865,6 @@ v850_select_section (tree exp, > { > int is_const; > if (!TREE_READONLY (exp) > - || TREE_SIDE_EFFECTS (exp) > || !DECL_INITIAL (exp) > || (DECL_INITIAL (exp) != error_mark_node > && !TREE_CONSTANT (DECL_INITIAL (exp))))