Miles Bader wrote:
> Hollis Blanchard <hollisb@us.ibm.com> writes:
>
>>Inlines don't always help performance (depending on cache sizes, branch
>>penalties, frequency of code access...), but they do always increase
>>code size.
>
>
> Um, inlining can often _decrease_ code size because it gives the
> compiler substantial new opportunities for optimization (the function
> body is no longer opaque, so the compiler has a lot more info, and any
> optimizations done on the inlined body can be context-specific).
>
starting from -O3 gcc do always trys to do inlining.
was observed on gcc 3.2 and I beleive I saw the same 2.95.3
compile this test with 02 & 03:
-------------------
#include <stdio.h>
int aaa() { return 32; }
int main() {
int b = aaa();
printf("hello %d \n", b);
return 0;
}
------------------
and then objdump -d to see the difference between main()s: 02 - you
will see function call, 03 - you will see just raw number 0x20 used.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:35 EST