Optimisation of unused static functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

gcc-3.3.2 for i686-pc-linux-gnu target _keeps_ unused static functions
in object file, and produces warnings like:

probe.c:2: warning: `bar' defined but not used


arm-wince-pe-gcc (GCC) 3.4 20031112 (experimental) for arm-wince-pe
target produces the same warning, but _eliminates_ the dead code.

Options are "-O2 -c -Wall probe.c".

Is it a deliberate change in gcc?
Is there a way to get the old behavior without decreasing optimization
level to O1?

We are using a trick with putting static functions references and
related data into a custom section to collect them inside a contiguous
memory block. So the code of that functions is not really "dead", the
data from that custom section is copied to .rdata section during final
linking, and used at run-time.


...Bye..Dmitry.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux