Read-only data handling: a proposal
Martin Mares
mj@atrey.karlin.mff.cuni.cz
Tue Sep 16 02:18:00 GMT 1997
Hello,
> Hmm, wait. I thought we already had code to keep/discard static constants
> (-fkeep-static-constants or some such) Or are we discussing global constants?
> If so it seems to me -fkeep-unused-constants might be the right name for
> such an option.
OK.
> > I was suggesting deferring it until the end of a function -- it's doesn't
> > have the problems you've mentioned and it can produce better code on some
> > architectures if you have a smart assembler which can convert absolute refs
> > to PC-relative refs whenever possible.
> It certainly avoids those problems. Of course you lose the opportunity to
> merge more constants. But I guess something is better than nothing :-)
Well, I suggested deferring the output, not freeing of the memory. The
values we need to defer are already copied to permanently allocated memory
and since the tree nodes I propose to add are not allocated automatically
by the parser, but in the varasm code instead, there seems to be no problem
in allocating them permanently, too.
> The PC-rel stuff is useful, but the number of architectures where such tricks
> help are diminishing.
E.g., MC680x0, but AFAIK gas is not capable of such optimization yet.
Have a nice fortnight
--
Martin `MJ' Mares <mj@gts.cz> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"Foolproof operation: All parameters are hard coded."
More information about the Gcc
mailing list