This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [3.3/3.4] wrong handling of "extern const" variables
- From: Gunther Nikl <gni at gecko dot de>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 1 Sep 2003 14:02:56 +0200
- Subject: Re: [3.3/3.4] wrong handling of "extern const" variables
- References: <20030820133547.GA69202@lorien.int.gecko.de> <20030820163726.GB21161@redhat.com> <wvlisorf08e.fsf@prospero.boston.redhat.com> <20030821181142.GA21617@redhat.com> <wvl65kqg74f.fsf@prospero.boston.redhat.com> <20030822082331.GA25988@lorien.int.gecko.de>
On Fri, Aug 22, 2003 at 10:23:31AM +0200, Gunther Nikl wrote:
> On Thu, Aug 21, 2003 at 03:09:36PM -0400, Jason Merrill wrote:
> > On Thu, 21 Aug 2003 11:11:42 -0700, Richard Henderson <rth@redhat.com> wrote:
> > > On Thu, Aug 21, 2003 at 12:23:45PM -0400, Jason Merrill wrote:
> > >> TREE_STATIC has never been set on decls with DECL_EXTERNAL set.
> > >
> > > Why not? Such a decl *must* be in static storage.
> >
> > Yes, but traditionally TREE_STATIC has meant "in static storage in the
> > current translation unit". I'm used to checking TREE_STATIC ||
> > DECL_EXTERNAL in most cases.
>
> Adding a DECL_EXTERNAL check in explow.c/maybe_set_unchanging() would
> cause RTX_UNCHANGING_P() to be set as it was before. But I guess that
> would render the test useless.
> http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00533.html states that this
> patch for opt/8364 is only a work-around.
I just noticed that you installed another patch for maybe_set_unchanging:
http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00755.html
where you write:
I don't see any good reason to treat decls with no DECL_INITIAL as
unchanging.
Is that correct for truly "extern const" references?
Gunther