This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix segfault in vectorizer


> Surely any missing vectype for a statement due to this delay is a bug.  I
> didn't notice STMT_VINFO_LIVE_P should be checked in addition to
> STMT_VINFO_RELEVANT_P.

In fact this brings back PR tree-opt/68327 on the 6 branch:

(gdb) frame 0
#0  internal_error (gmsgid=gmsgid@entry=0x170cd58 "in %s, at %s:%d")
    at /home/eric/svn/gcc-6-branch/gcc/diagnostic.c:1251
1251    {
(gdb) frame 1
#1  0x000000000101c5c4 in fancy_abort (file=<optimized out>, 
    line=<optimized out>, function=<optimized out>)
    at /home/eric/svn/gcc-6-branch/gcc/diagnostic.c:1327
1327      internal_error ("in %s, at %s:%d", function, trim_filename (file), 
line);
(gdb) frame 2
#2  0x0000000000b75f5e in vect_is_simple_use (operand=0x7ffff6c3f9d8, 
    vinfo=0x1ddb690, def_stmt=0x7fffffffd888, dt=0x7fffffffd86c, 
    vectype=0x7fffffffd878)
    at /home/eric/svn/gcc-6-branch/gcc/tree-vect-stmts.c:8763
8763          gcc_assert (*vectype != NULL_TREE);
(gdb) p debug_gimple_stmt(*def_stmt)
b.0_2 = PHI <b.0_22(4), _17(7)>
$5 = void

because we don't compute STMT_VINFO_VECTYPE for live PHI statement, but only 
for relevant ones, so we need this too:

Index: tree-vect-loop.c
===================================================================
--- tree-vect-loop.c    (revision 236983)
+++ tree-vect-loop.c    (working copy)
@@ -216,7 +216,8 @@ vect_determine_vectorization_factor (loo
 
          gcc_assert (stmt_info);
 
-         if (STMT_VINFO_RELEVANT_P (stmt_info))
+         if (STMT_VINFO_RELEVANT_P (stmt_info)
+             || STMT_VINFO_LIVE_P (stmt_info))
             {
              gcc_assert (!STMT_VINFO_VECTYPE (stmt_info));
               scalar_type = TREE_TYPE (PHI_RESULT (phi));

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]