This is the mail archive of the
mailing list for the GCC project.
Re: Mark more constants readonly
- From: Bernd Schmidt <bernds at codesourcery dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 28 May 2014 12:00:26 +0200
- Subject: Re: Mark more constants readonly
- Authentication-results: sourceware.org; auth=none
- References: <53848F63 dot 2010500 at codesourcery dot com> <CAFiYyc2v6r1rtaXGC=ZG8Dza7_keGa_Nu9LhC7JCp7cKdTSC5Q at mail dot gmail dot com>
On 05/27/2014 04:57 PM, Richard Biener wrote:
On Tue, May 27, 2014 at 3:13 PM, Bernd Schmidt <firstname.lastname@example.org> wrote:
I noticed that string constants built by the Fortran frontend don't set
TREE_READONLY for STRING_CST (and subsequently noticed that nothing seems to
set it for COMPLEX_CST). That was confusing the ptx backend I'm working on.
The -fwritable-strings option for C was removed a while ago, so I tested the
following patch to just set the flag unconditionally, and passed bootstrap
and test on x86_64-linux. Ok?
Hmm? Not so obvious. TREE_READONLY has no purpose on tcc_constant
nodes if I read documentation correctly (tree.h). In fact
base.readonly_flag is unused for tcc_constant (and would be redundant
Well, the C frontend still sets it for strings (in fix_string_type), and
gcc.dg/lvalue-5.c fails if that is removed. So things are a little
inconsistent between frontends.