https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85459
--- Comment #12 from Martin Jambor <jamborm at gcc dot gnu.org> --- Author: jamborm Date: Wed Apr 17 15:52:16 2019 New Revision: 270414 URL: https://gcc.gnu.org/viewcvs?rev=270414&root=gcc&view=rev Log: 2019-04-17 Martin Jambor <mjam...@suse.cz> Backport from mainline 2019-03-10 Martin Jambor <mjam...@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. Added: branches/gcc-8-branch/gcc/testsuite/g++.dg/tree-ssa/pr87008.C Modified: branches/gcc-8-branch/gcc/ChangeLog branches/gcc-8-branch/gcc/testsuite/ChangeLog branches/gcc-8-branch/gcc/testsuite/gcc.dg/guality/pr54970.c branches/gcc-8-branch/gcc/tree-sra.c