This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/58497] SLP vectorizes identical operations
- 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: Wed, 11 Nov 2015 13:08:43 +0000
- Subject: [Bug tree-optimization/58497] SLP vectorizes identical operations
- Auto-submitted: auto-generated
- References: <bug-58497-4 at http dot gcc dot gnu dot org/bugzilla/>
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).