Make SRA less strict with memcpy performing MEM_REFs
authorMartin Jambor <mjambor@suse.cz>
Sun, 10 Mar 2019 16:20:06 +0000 (17:20 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Sun, 10 Mar 2019 16:20:06 +0000 (17:20 +0100)
commitb496651b7d281bd1bf22688f4de0cbb78c1bf8e5
tree8a9e5b2bc72dddda093b0e99bf113af636f6c757
parent7f862706a22c2ce0b94390c5b6ecd3cb15a135d9
Make SRA less strict with memcpy performing MEM_REFs

2019-03-10  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/85762
PR tree-optimization/87008
PR tree-optimization/85459
* tree-sra.c (contains_vce_or_bfcref_p): New parameter, set the bool
it points to if there is a type changing MEM_REF.  Adjust all callers.
(build_accesses_from_assign): Disable total scalarization if
contains_vce_or_bfcref_p returns true through the new parameter, for
both rhs and lhs.

testsuite/
* g++.dg/tree-ssa/pr87008.C: New test.
* gcc.dg/guality/pr54970.c: Xfail tests querying a[0] everywhere.

From-SVN: r269556
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr87008.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/guality/pr54970.c
gcc/tree-sra.c