From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16498 invoked by alias); 25 Oct 2011 20:04:50 -0000 Received: (qmail 16488 invoked by uid 22791); 25 Oct 2011 20:04:48 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Oct 2011 20:04:34 +0000 From: "greed at pobox dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C Date: Tue, 25 Oct 2011 20:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: greed at pobox dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg02602.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316 Graham Reed changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |greed at pobox dot com --- Comment #2 from Graham Reed 2011-10-25 20:04:32 UTC --- This may be the same fault I'm seeing on AIX with GCC 4.6.1--does Tru64 use an "emulated TLS" as well? I reduced diag-1.C to this: template struct B { static __thread T t; }; template __thread T B::t = 42; void bar () { int j = B::t; } If it is the same fault, what's happening is, a weak, public reference is being created for the TLS emulation template for B::t. When it is used to initialize j, the public flag is cleared--it's local, after all. (This is in tree-emutls.c at lines 238 to 247 in both 4.6.1 and SVN revision 180430.) But the assertion in ipa.c "knows" anything weak must be either public or extern--that's the error in the ICE message. I don't know if the error is in clearing the 'public' flag, or in assuming everything weak is public or extern. Note I haven't yet gotten the trunk code to build; we've got a bit of a shortage of AIX horsepower. As there are trunk changes in both ipa.c and tree-emutls.c, it is possible AIX is fine with trunk but Tru64 still has issues.