This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: random thought - optimizer
- To: Zack Weinberg <zackw at stanford dot edu>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Subject: Re: random thought - optimizer
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sun, 01 Jul 2001 23:35:13 -0700
> My question is, what sort of analysis would it take to recognize this
> condition?
Nothing we don't already have (it's just standard unused code elimination
stuff) -- but most of our optimizers are severely limited in that they
assume that a REG is the only useful unit of optimization. Your variable
isn't a REG because it lives forever, it's a MEM (and you did remember
that we committed to code shape and data layout early, so this was
decided long before optimization time). Since it's a MEM, we just
don't do the right thing.
There are, of course, hacks that we could do to get this right.
But, the right thing is to rewrite our optimizations to work on
cleaned up trees. Then it would Just Work.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com