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

--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Created attachment 31402
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31402&action=edit
Patch detaching arrays away from aggregates

Eric, to what extent would this patch suffice?  It detects situations
when an array is the only thing preventing a local scalar from being
totally replaced disappearing and if it also complies with a number of
conditions (most importantly, it must not be accessed as whole, only
its elements), it creates a separate array and changes all array
references to use that.  While it most certainly isn't as powerful as
your specialized patch, it also works on non-FRAMEs and is good enough
to break them up in your testcase (and its slightly more complex
variant included as the second testcase in the patch).

The patch is fairly simple because it only deals with so called
non-scalarizable regions which other parts of SRA stay away from.  In
theory we could detach each independently accessed part of an
aggregate but that would require rewriting the ugliest parts of the
pass (and not really making them any clearer), hence the question at
the top of my post.

Reply via email to