From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20598 invoked by alias); 12 Mar 2010 00:10:18 -0000 Received: (qmail 20585 invoked by uid 22791); 12 Mar 2010 00:10:16 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from g4t0016.houston.hp.com (HELO g4t0016.houston.hp.com) (15.201.24.19) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Mar 2010 00:10:12 +0000 Received: from smtp1.cup.hp.com (hpda.cup.hp.com [16.89.217.160]) by g4t0016.houston.hp.com (Postfix) with ESMTP id C6C0C142CE; Fri, 12 Mar 2010 00:10:09 +0000 (UTC) Received: from [16.89.92.85] (hpsje.cup.hp.com [16.89.92.85]) by smtp1.cup.hp.com (Postfix) with ESMTP id 900E551500D; Thu, 11 Mar 2010 23:46:28 +0000 (UTC) Subject: Re: PR c/43288 (ICE with __attribute__ ((common))) From: Steve Ellcey Reply-To: sje@cup.hp.com To: John David Anglin Cc: hubicka@ucw.cz, gcc-patches@gcc.gnu.org In-Reply-To: <20100311215459.C03784EF1@hiauly1.hia.nrc.ca> References: <20100311215459.C03784EF1@hiauly1.hia.nrc.ca> Content-Type: text/plain Date: Fri, 12 Mar 2010 00:19:00 -0000 Message-Id: <1268352609.9544.12.camel@hpsje.cup.hp.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg00469.txt.bz2 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 for instructions. $ cat b.C class t { virtual ~t(); }; namespace __cxxabiv1 { class foo : public t {}; } $ obj_gcc/gcc/cc1plus -quiet b.C