On Feb 9 2007 14:04, Andi Kleen wrote:
>Andrew Morton <[EMAIL PROTECTED]> writes:
>> 
>> As long as nobody takes the address of them (which wouldn't compile today
>> anyway) then the compiler should be able to not allocate store for these. 
>
>This would only work for unit-at-a-time compilers (if it works at all,
>i'm not sure), but not older 3.x compilers
>
>> That they're const might help too.
>
>Don't think it does.

GCC 4.1 optimizes both Andrew's and Frederik Deweerdt's ideas 
perfectly out. Even if the const was not there in Frederik's example, 
gcc seems throw it out with -O2 (judging by `nm` output) since it is
1. static 2. unused. Gcc even gives out a warning that the item is 
unused when not marked with const.


Jan
-- 
ft: http://freshmeat.net/p/chaostables/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to