The following makes sure we handle a SLP load/store group from
a structure with complex and scalar members.  This for example
happens in gcc.target/i386/pr106010-9a.c.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

        * tree-vect-slp.cc (vect_build_slp_tree_1): Handle mixing
        all of handled components besides ARRAY_RANGE_REF, drop
        handling of INDIRECT_REF.
---
 gcc/tree-vect-slp.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index d6cec97cb59..01a03e17fb4 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -1318,13 +1318,15 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char 
*swap,
               && !(STMT_VINFO_GROUPED_ACCESS (stmt_info)
                    && (first_stmt_code == ARRAY_REF
                        || first_stmt_code == BIT_FIELD_REF
-                       || first_stmt_code == INDIRECT_REF
                        || first_stmt_code == COMPONENT_REF
+                       || first_stmt_code == REALPART_EXPR
+                       || first_stmt_code == IMAGPART_EXPR
                        || first_stmt_code == MEM_REF)
                    && (rhs_code == ARRAY_REF
                        || rhs_code == BIT_FIELD_REF
-                       || rhs_code == INDIRECT_REF
                        || rhs_code == COMPONENT_REF
+                       || rhs_code == REALPART_EXPR
+                       || rhs_code == IMAGPART_EXPR
                        || rhs_code == MEM_REF)))
              || (ldst_p
                  && (STMT_VINFO_GROUPED_ACCESS (stmt_info)
-- 
2.43.0

Reply via email to