Make SRA re-construct orginal memory accesses when easy
authorMartin Jambor <mjambor@suse.cz>
Thu, 6 Jun 2019 16:31:20 +0000 (18:31 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Thu, 6 Jun 2019 16:31:20 +0000 (18:31 +0200)
commit3b47da42de621c6c3bf7d2f9245df989aa7eb5a1
tree4c37321fcafb5e38a43aea877ba8703f2d1540a7
parentbeb0086f592563ddd2b14444d4e2495b17b1d4bf
Make SRA re-construct orginal memory accesses when easy

2019-06-06  Martin Jambor  <mjambor@suse.cz>

* tree-sra.c (struct access): New field grp_same_access_path.
(dump_access): Dump it.
(build_reconstructed_reference): New function.
(build_ref_for_model): Use it if possible.
(path_comparable_for_same_access): New function.
(same_access_path_p): Likewise.
(sort_and_splice_var_accesses): Set the new flag.
(analyze_access_subtree): Likewise.
(propagate_subaccesses_across_link): Propagate zero value of the new
flag down the access tree.

testsuite/
* gcc.dg/tree-ssa/alias-access-path-1.c: Remove -fno-tree-sra option.
* gcc.dg/tree-ssa/ssa-dse-26.c: Disable FRE.
* testsuite/gnat.dg/opt39.adb: Adjust scan dump.

From-SVN: r272012
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-1.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
gcc/testsuite/gnat.dg/opt39.adb
gcc/tree-sra.c