This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: random thought - optimizer


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]