This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/8108] Problem in the code generator for C and the linker is extremelly slow
- From: "stephan dot tobies at nokia dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Mar 2004 12:14:31 -0000
- Subject: [Bug c/8108] Problem in the code generator for C and the linker is extremelly slow
- References: <20021001081602.8108.manuel.serrano@sophia.inria.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From stephan dot tobies at nokia dot com 2004-03-29 12:14 -------
Hi,
I have also encountered this problem and, after spending some time profiling and
analyzing ld, have found what the problem is:
It seems that ld uses a non-optimal algorithm to merge strings. This is done, if
I understand correctly, to be able to represent strings that are suffixes of
other strings as pointers into the longer string. Even though some hashing is
used in ld to reduce the search time, the employed algorithm has more or less
quadratic runtime in the number of strings.
I assume that the placement of debug information has changed between older gcc
versions and newer gcc versions and that now the debug information is also mergable.
This may lead to a dramatic increase in linking time when switching from older
versions to newer (3.2.2 for me) release. I have encountered a rise from ~10
seconds to ~1h.
Suggestion: of course this should best be fixed in ld directly, and I will talk
to the guys there, but it would also help if gcc would receive an option that
makes it treat debug information as non-mergable data.
BR
Stephan
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8108