This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/50413] [4.6/4.7 Regression] Incorrect instruction is used to shift value of 128 bit xmm0 registrer


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50413

--- Comment #7 from Ira Rosen <irar at il dot ibm.com> 2011-09-18 10:17:12 UTC ---
Right. The data-refs analysis fails for the bit assignment, and SLP marks this
statement as not vectorizable and continues with the vectorization of other
statements, which is incorrect because we ignore a possible dependence (as it
happens here).

Instead of just failing for data-refs that can't be analyzed (as in the patch
below), we can check that the statement with the data-ref is either before the
first load or after the last store of the SLP instance, verifying that there is
no data dependence. But this patch is enough to prevent vectorization here and
fix the bug.

Index: tree-vect-data-refs.c
===================================================================
--- tree-vect-data-refs.c       (revision 178880)
+++ tree-vect-data-refs.c       (working copy)
@@ -2577,14 +2602,7 @@ vect_analyze_data_refs (loop_vec_info lo
               print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
             }

-          if (bb_vinfo)
-            {
-              /* Mark the statement as not vectorizable.  */
-              STMT_VINFO_VECTORIZABLE (stmt_info) = false;
-              continue;
-            }
-          else
-            return false;
+          return false;
         }

       if (TREE_CODE (DR_BASE_ADDRESS (dr)) == INTEGER_CST)
@@ -2592,14 +2610,7 @@ vect_analyze_data_refs (loop_vec_info lo
           if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
             fprintf (vect_dump, "not vectorized: base addr of dr is a "
                      "constant");
-          if (bb_vinfo)
-            {
-              /* Mark the statement as not vectorizable.  */
-              STMT_VINFO_VECTORIZABLE (stmt_info) = false;
-              continue;
-            }
-          else
-            return false;
+          return false;
         }

       if (TREE_THIS_VOLATILE (DR_REF (dr)))


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