public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Optimisation of unused static functions
@ 2003-12-03 16:45 Dmitry Semyonov
  0 siblings, 0 replies; only message in thread
From: Dmitry Semyonov @ 2003-12-03 16:45 UTC (permalink / raw)
  To: gcc-help

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-12-03 16:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-03 16:45 Optimisation of unused static functions Dmitry Semyonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).