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.

Reply via email to