------- Comment #5 from jamborm at gcc dot gnu dot org 2009-07-30 17:07 ------- Created an attachment (id=18273) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18273&action=view) Proposed patch
The attached patch does turn SRA down a bit. Specifically, in order to create a replacement, the corresponding access (group) must either: - be read individually multiple times or - be read individually and also written to (either individually or through its parent) or - somehow accessed individually and be on the RHS of structure copy-prop link or - be read individually and be on the LHS of structure copy-prop link. (The bottom line is to avoid scalarizing accesses with only stores or just one read - and no stores. Another thing to be noted is that with this patch we also insist the access must be at least once read individually, not as a part of its parent to be scalarized.) I'm bootstrapping and testing this at the moment but only to find out that the testcase changes are OK, the last bootstrap with exactly these changes to tree-sra.c finished fine. I want to have benchmarks run on this, however, to make sure I do not do any harm. I expect to be benchmarking ipa-cp cloning the next couple of days and do this right afterwards, I guess early next week. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40744