This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/56270] [4.6/4.7/4.8 Regression] loop over array of struct float causes compiler error: segmentation fault
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 04 Mar 2013 14:19:37 +0000
- Subject: [Bug tree-optimization/56270] [4.6/4.7/4.8 Regression] loop over array of struct float causes compiler error: segmentation fault
- Auto-submitted: auto-generated
- References: <bug-56270-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56270
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-04 14:19:37 UTC ---
We don't properly "vectorize" the 2nd reference to the load (this time
unpermuted). When vectorizing the 2nd SLP instance with that reference
we encounter
/* Check if the chain of loads is already vectorized. */
if (STMT_VINFO_VEC_STMT (vinfo_for_stmt (first_stmt)))
{
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
return true;
}
but that leaves SLP_TREE_VEC_STMTS unpopulated. Shared nodes between SLP
instances seem to be somewhat fragile ...
Especially in this case in which even wrong-code would occur as the
instances do not share the same permutation.
if (slp
&& !SLP_INSTANCE_LOAD_PERMUTATION (slp_node_instance).exists ()
&& first_stmt != SLP_TREE_SCALAR_STMTS (slp_node)[0])
first_stmt = SLP_TREE_SCALAR_STMTS (slp_node)[0];
also doesn't make much sense to me - instead it probably should be asserted:
if (slp
&& first_stmt != SLP_TREE_SCALAR_STMTS (slp_node)[0])
gcc_assert (SLP_INSTANCE_LOAD_PERMUTATION (slp_node_instance).exists
())
but bb-slp-29.c asserts here.
Easiest is for now to clear STMT_VINFO_VEC_STMT for all loads after
scheduling an SLP instance.