2019-04-17  Martin Jambor  <mjambor@suse.cz>

	Backport from mainline
	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.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-8-branch@270414 138bc75d-0d04-0410-961f-82ee72b054a4
5 files changed