On 08/25/2015 05:06 AM, Alan Lawrence wrote:
This changes the completely_scalarize_record path to also work on arrays (thus
allowing records containing arrays, etc.). This just required extending the
existing type_consists_of_records_p and completely_scalarize_record methods
to handle things of ARRAY_TYPE as well as RECORD_TYPE. Hence, I renamed both
methods so as not to mention 'record'.
Bootstrapped + check-gcc on aarch64-none-linux-gnu, arm-none-linux-gnueabihf
and x86_64-none-linux-gnu.
Have also verified the scan-tree-dump check in the new sra-15.c passes (using a
stage 1 compiler only, no execution test) on alpha, hppa, powerpc, sparc, avr
and sh.
gcc/ChangeLog:
* tree-sra.c (type_consists_of_records_p): Rename to...
(scalarizable_type_p): ...this, add case for ARRAY_TYPE.
(completely_scalarize_record): Rename to...
(completely_scalarize): ...this, add ARRAY_TYPE case, move some code to:
(scalarize_elem): New.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/sra-15.c: New.
---
gcc/testsuite/gcc.dg/tree-ssa/sra-15.c | 38 +++++++++
gcc/tree-sra.c | 146 ++++++++++++++++++++++-----------
2 files changed, 135 insertions(+), 49 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/sra-15.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-15.c
b/gcc/testsuite/gcc.dg/tree-ssa/sra-15.c
new file mode 100644
index 0000000..e251058
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-15.c
@@ -0,0 +1,38 @@
+/* Verify that SRA total scalarization works on records containing arrays. */
+/* Test skipped for targets with small (often default) MOVE_RATIO. */
?!? I don't see anything that skips this test for any targets.
Presumably this was copied from sra-12.c. I suspect this comment should
just be removed.
With that comment removed from the testcase, this is OK.
jeff