------- Comment #2 from rguenther at suse dot de  2009-07-14 21:28 -------
Subject: Re:  SRA scalarizes dead objects,
 single-use objects

On Tue, 14 Jul 2009, jamborm at gcc dot gnu dot org wrote:

> ------- Comment #1 from jamborm at gcc dot gnu dot org  2009-07-14 16:32 
> -------
> OK, I have now added this to my todo list.  The simple tweaks would be
> simple.  On  the other hand, if  DCE is clever, it  still might figure
> out a structure is dead at  some code paths while I don't even attempt
> to and still remove some statements.
> 
> > only loads from a structure or only stores to a structure
> > probably should be simply skipped.
> 
> I've been thinking about not scalarizing accesses that occur only once
> too.  Thinking about it more,  I wonder whether requiring at least one
> load and  a store or  at least  two loads is  a good idea.   (Load and
> store for the case where we  store something to an aggregate first and
> then load it and  two loads for the case when we  can finally get away
> with one.)

Note that it is important to keep the structure copyprop case

 tmp = b;
 return tmp;

which happens quite often in C++ code.

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40744

Reply via email to