Has icc/icpc 14.0 lost ability to inline from .a libraries?

Has icc/icpc 14.0 lost ability to inline from .a libraries?

I did the following and could not get f to be inlined.

$ cat test.c
int f() {
return 3;
}
$ cat test.cc
#include <cstdio>

using namespace std;

extern "C" int f();

int main() {
printf("%d\n", f());
}
$ icc -c test.c -ipo
$ xiar cr libtest.a test.o
xiar: executing 'ar'
$ icpc -c test.cc -ipo
$ icpc test.o libtest.a -ipo -otest
$ objdump -d test|grep '<f>'
400ae2: e8 19 00 00 00 callq 400b00 <f>
0000000000400b00 <f>:
$ icpc -v
icpc version 14.0.0 (gcc version 4.8.0 compatibility)
$ icc -v
icc version 14.0.0 (gcc version 4.8.0 compatibility)

1 条帖子 / 0 全新
如需更全面地了解编译器优化,请参阅优化注意事项