LTO question

Bingfeng Mei
Tue Oct 13 12:51:00 GMT 2009

I just had the first taste with the latest LTO merge on our port.  
Compiler is configured with LTO enabled and built correctly. 
I tried the following example: 
extern void foo(int);
int main()
{  foo(20);
  return 1;

#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. 
Did I miss something here? Are there new hooks I should specify or tune for 
LTO? I checked the up-to-date internal manual and found nothing.
Bingfeng Mei

More information about the Gcc mailing list