This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [LTO merge][6/15][RFA] Driver
Rafael Espindola <espindola@google.com> writes:
>> Thanks for the explanation. ÂThis may be a reasonable thing to do
>> initially, but it doesn't seem to be a full solution, as there are other
>> cases where symbol references could be introduced - built-in function
>> optimizations transforming a call to one function to a call to another
>> (likely in libc, which could be being linked statically), at least. ÂDo
>> you have any way to eliminate that possibility?
>
> I never found a case where we created calls to functions that were not
> in libgcc. That is why the option has that name :-)
The optimizers will convert calls to printf into calls to puts when
possible. There are other similar transformations.
E.g., try compiling "int foo() { printf("hi\n"); }".
As I understand your explanation this will only be a problem when
linking statically against libc, so it is not a common case. But it
seems like a real one.
Ian