lkml.org 
[lkml]   [2003]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Use -fno-unit-at-a-time if gcc supports it
Andreas Jaeger wrote:
[...]
> The problem is that unit-at-a-time sees all functions used and finds
> some static functions/variables that are not called anywhere and
> therefore drops them, making a smaller binary. Since GCC does not
> look into inline assembler, anything referenced from inline assembler
> only, will be treated as not used and therefore removed.
>
> You have to options:
> - use attribute ((used)) (implemented since GCC 3.2) to tell GCC that
> a function/variable should never be removed
> - use -fno-unit-at-a-time.
>
> Since unit-at-a-time has better inlining heuristics the better way is
> to add the used attribute - but that takes some time. The short-term
> solution would be to add the compiler flag,
>
Seems to me that a better solution is to mark the assembly code
in question so gcc knows that is somehow calls the function.
That still allows optimizing away the function whenever the
assembly itself is left out. (Module not compiled or similiar)
Marking the function "used" includes it anyway.

I realize this way probably isn' supported right now,
but people are talking about changing gcc so I
mentioned it as an ideal way.

Helge Hafting


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.056 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site