This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inline-unit-growth trouble


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]