gcc: how to optimize out dead strings?
Peter Samuelson
peter@cadcamlab.org
Tue Nov 21 03:45:00 GMT 2000
[not subscribed to gcc-help, please cc, no pun intended]
gcc is pretty good at optimizing out dead code, but what about dead
string constants?
void foo(int x)
{
if (0)
printf("bar");
}
As of 2.95.2 on i386-linux{-gnu(:}, the constant "bar\0" still takes up
unwanted space in my object file. Any way to get rid of it at compile
time? (cpp is not an option.)
Oh, by the way, the same applies to static variables. Dead static
variables are bad too.
Thanks,
Peter
More information about the Gcc-help
mailing list