This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR c/43288 (ICE with __attribute__ ((common)))
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: hubicka at ucw dot cz, gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Mar 2010 16:10:09 -0800
- Subject: Re: PR c/43288 (ICE with __attribute__ ((common)))
- References: <20100311215459.C03784EF1@hiauly1.hia.nrc.ca>
- Reply-to: sje at cup dot hp dot com
On Thu, 2010-03-11 at 16:54 -0500, John David Anglin wrote:
> > I think I have a var decl that is weak and common because that is
> > how HPPA is doing comdats in SOM. Dave can correct me if I have
> > that wrong.
>
> See define for MAKE_DECL_ONE_ONLY in som.h. We don't set both
> DECL_COMMON and DECL_WEAK. Some other code must be setting
> DECL_COMMON or DECL_WEAK to cause the error (or maybe MAKE_DECL_ONE_ONLY
> is used twice, once before DECL_INITIAL is set).
>
> Dave
Yes, MAKE_DECL_ONE_ONLY is called twice because make_decl_one_only is
called twice. The first call seems to happen before we have an
initializer and the second one after. We could workaround this by
setting DECL_COMMON to 0 when setting DECL_WEAK to 1 (and visa versa) in
MAKE_DECL_ONE_ONLY but I think that is just a workaround for the real
problem. The problem seems to only happen when using the
"__fundamental_type_info" class. If I change the name of this class to
something generic like "foo" then I don't get the bug.
Steve Ellcey
sje@cup.hp.com
$ cat a.C
class t { virtual ~t(); };
namespace __cxxabiv1 {
class __fundamental_type_info : public t {};
}
$ obj_gcc/gcc/cc1plus -quiet a.C
a.C:4:1: internal compiler error: in make_decl_rtl, at varasm.c:1447
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ cat b.C
class t { virtual ~t(); };
namespace __cxxabiv1 {
class foo : public t {};
}
$ obj_gcc/gcc/cc1plus -quiet b.C