This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
- From: "greed at pobox dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Oct 2011 20:04:32 +0000
- Subject: [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
- Auto-submitted: auto-generated
- References: <bug-49316-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316
Graham Reed <greed at pobox dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |greed at pobox dot com
--- Comment #2 from Graham Reed <greed at pobox dot com> 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 <typename T> struct B { static __thread T t; };
template <typename T> __thread T B<T>::t = 42;
void bar () { int j = B<int>::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<int>::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.