This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: inline-unit-growth trouble
- From: Christopher Jefferson <caj at cs dot york dot ac dot uk>
- To: Mike Stump <mrs at apple dot com>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, Andreas Krebbel <krebbel1 at de dot ibm dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 15 Apr 2005 21:49:57 +0100
- Subject: Re: inline-unit-growth trouble
- References: <92420DA6-ADE3-11D9-B4A4-003065BDF310@apple.com>
Mike Stump wrote:
On Friday, April 15, 2005, at 11:50 AM, Christopher Jefferson wrote:
Is it really the job of the linker to choose between different
implementations of a function?
Yes. Why do you ask?
Because I'm not an expert on linkers :)
It seems to me that this might lead to very, very difficult to track
down bugs....
Nope. All those bugs are trivial to track down, as once you find the
translation unit that contained the compiled code with something called
a debugger,
OK, it was a silly question, but was it necessary to be that insulting?
you submit the -E for it and that flags used to compile it,
and because the compiler is deterministic, all such bugs are trivial to
track down.
I was more thinking a situation like:
1) I write slightly buggy file A, which generates some some function in
.gnu.linkonce from a library function. I also have good file B (assume A
and B have no real connection), which generates the same library
function. My program works.
2) I edit and recompile file B which causes some different inlining to
occur in the functions in .gnu.linkonce. B's copy of the library
function gets chosen, and this happens to break functions in file A. I
assume however the bug has to be in file B, as thats what I just
changed, and it has no connection to file A I know of.
Of course it's been pointed out that of course exactly the same problem
occurs if you compile different files at different optimisation levels,
so it's unavoidable anywhere perhaps...
Chris