This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Can we speed up the gcc_target structure?
On Sun, Jan 18, 2004 at 09:14:14PM +0000, Joseph S. Myers wrote:
> When --enable-intermodule is used, does (or should) the compiler manage to
> detect which parts of the target structure are in fact constant (even
> without constifying)?
I'm certain that it doesn't.
It's not inconcievable that a compiler could not that there are
never any writes to a structure, promote it to readonly, and then
constant propagate the values out of that structure.
However, that sort of optimization requires that you see the *entire*
program, not just large parts of it, as with the current intermodule
code. So I expect this sort of thing is relatively far away.
One possibility is a switch that says "except for main, nothing
outside these files reference any of the symbols herein defined."
That might get you the same effect as whole-program optimization
without having to have extra info about external runtime libraries.
r~