LTO question
Diego Novillo
dnovillo@google.com
Tue Oct 13 13:47:00 GMT 2009
On Tue, Oct 13, 2009 at 08:47, Bingfeng Mei <bmei@broadcom.com> wrote:
> a.c
> extern void foo(int);
> int main()
> { foo(20);
> return 1;
> }
>
> b.c
> #include <stdio.h>
> void foo(int c)
> {
> printf("Hello world: %d\n", c);
> }
>
> compiled with:
> firepath-elf-gcc -flto a.c b.c -save-temps -O2
>
> I expected that foo should be inlined into main, but not. Both functions
> of main and foo are present in a.s, while b.s contains the LTO code.
Try adding -fwhole-program.
Diego.
More information about the Gcc
mailing list