This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/50620] "undefined reference" errors / csmith lto testing
- From: "hubicka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 09 Oct 2011 13:28:40 +0000
- Subject: [Bug lto/50620] "undefined reference" errors / csmith lto testing
- Auto-submitted: auto-generated
- References: <bug-50620-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50620
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu.org
--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-10-09 13:28:40 UTC ---
The problem here is different than one in PR50620.
What happens is that we ship constructors of const static variables into every
partition that reffers to that to aid possible folding of loads from the var.
The constructor of variable pointing to g_331 gets shipped to ltrans1 even when
it is otherwise in other partition. Eventually we fold and place direct
reference to g_331 into code, but the logic promoting symbols hidden doesn't
really consider this posibility, so we end up with undefined reference.
I guess the whole promotion code will need some cleanups and updating - first
the logic is all duplicated in between lto.c and lto-cgraph.c and it is O(n^2),
and second it is not really easy to tweak it to solve this problem - it is
based on the fact that only funcions/variable sin the partition may cause
promotion, while the variable pointing to g_331 is not in ltrans1.
Honza