[Bug tree-optimization/77485] Missed dead store elimination of aggregate store followed by partial stores

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Fri Dec 9 07:57:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77485

--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 8 Dec 2016, law at redhat dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77485
> 
> --- Comment #4 from Jeffrey A. Law <law at redhat dot com> ---
> So my patches for 33562 will detect the partial dead store in "foo", but I
> never wrote the bits to narrow partial dead stores.
> 
> The difficulty in optimizing this particular case will be rewriting the
> CONSTRUCTOR node.  Though it may be as simple as walking down the CONSTRUCTOR
> and splicing out components which correspond to dead assignments -- I'll have
> to familiarize myself with the guts of how to walk CONSTRUCTOR nodes. 
> Hopefully they're at least in-order and extracting byte offsets is easy :-)

Should be.

But I still think any "real" DSE work should be done by unifying what
SRA, update-address-taken, store-merging and current DSE do (eventually 
even the bswap pass).  Those are all related and they share basic analysis
(and dataflow) parts and would benefit from each other transform "tricks".

And all of them would benefit from being flow-sensitive in a way to
consider parts of the CFG where for example addresses do not escape
and doing some (eventually expensive) stuff at such (cold?) region 
boundaries.


More information about the Gcc-bugs mailing list