[Bug middle-end/66251] [6 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1484

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 22 10:18:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66251

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matz at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a fix for the ICE:

Index: gcc/tree-vect-stmts.c
===================================================================
--- gcc/tree-vect-stmts.c       (revision 223529)
+++ gcc/tree-vect-stmts.c       (working copy)
@@ -3964,14 +3964,12 @@ vectorizable_conversion (gimple stmt, gi

              if (slp_node)
                SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
+
+             if (!prev_stmt_info)
+               STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
              else
-               {
-                 if (!prev_stmt_info)
-                   STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
-                 else
-                   STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
-                 prev_stmt_info = vinfo_for_stmt (new_stmt);
-               }
+               STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+             prev_stmt_info = vinfo_for_stmt (new_stmt);
            }
        }

but I'm not sure we create correct code here.  The strided-store path
looks wrong to me.  Micha?

  vect__19.9_70 = [vec_unpack_lo_expr] vect_cst_.8_69;
  vect__19.9_71 = [vec_unpack_hi_expr] vect_cst_.8_69;
  _21 = (real(kind=8)) _20;
  _82 = BIT_FIELD_REF <vect__19.9_70, 64, 0>;
  MEM[(real(kind=8) *)ivtmp_72] = _82;
  ivtmp_84 = ivtmp_72 + _81;
  _85 = BIT_FIELD_REF <vect__19.9_70, 64, 64>;
  MEM[(real(kind=8) *)ivtmp_84] = _85;

we load a v4sf and unpack to two v2df vectors (unrolling factor of two
is applied).  But then the strided store code appears to just store
from the first vector, the realpart to the first unrolled iteration
destination realpart and the imagpart to the second unrolled interation
realpart!?

(gdb) p ncopies
$1 = 1
(gdb) p vec_num
$2 = 2

you somehow miss the loop over vec_num.  Or you miss to reject the
testcase for strided stores (possibly our patches just crossed here).
That is, SLP support seems to be absent here.

Joost - can you produce a runtime testcase that verifies correctness?

Meanwhile testing the ICE fixing patch.



More information about the Gcc-bugs mailing list