[Bug tree-optimization/58497] SLP vectorizes identical operations
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 11 13:08:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58497
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Index: gcc/tree-vect-generic.c
===================================================================
--- gcc/tree-vect-generic.c (revision 230146)
+++ gcc/tree-vect-generic.c (working copy)
@@ -105,6 +106,15 @@ static inline tree
tree_vec_extract (gimple_stmt_iterator *gsi, tree type,
tree t, tree bitsize, tree bitpos)
{
+ if (TREE_CODE (t) == SSA_NAME)
+ {
+ gimple *def_stmt = SSA_NAME_DEF_STMT (t);
+ if (is_gimple_assign (def_stmt)
+ && (gimple_assign_rhs_code (def_stmt) == VECTOR_CST
+ || (bitpos
+ && gimple_assign_rhs_code (def_stmt) == CONSTRUCTOR)))
+ t = gimple_assign_rhs1 (def_stmt);
+ }
if (bitpos)
{
if (TREE_CODE (type) == BOOLEAN_TYPE)
should fix it (in testing).
More information about the Gcc-bugs
mailing list