[3.3/3.4] wrong handling of "extern const" variables
Gunther Nikl
gni@gecko.de
Mon Sep 1 12:00:00 GMT 2003
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
More information about the Gcc
mailing list