OSDN Git Service

* c-common.c (parse_optimize_options): Do not capitalize warning
[pf3gnuchains/gcc-fork.git] / gcc / tree-vect-data-refs.c
index c76c60b..264a107 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "ggc.h"
 #include "tree.h"
+#include "tm_p.h"
 #include "target.h"
 #include "basic-block.h"
 #include "tree-pretty-print.h"
@@ -614,7 +615,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
         }
 
       /* We do not vectorize basic blocks with write-write dependencies.  */
-      if (!DR_IS_READ (dra) && !DR_IS_READ (drb))
+      if (DR_IS_WRITE (dra) && DR_IS_WRITE (drb))
         return true;
 
       /* We deal with read-write dependencies in basic blocks later (by
@@ -641,7 +642,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
         }
 
       /* Do not vectorize basic blcoks with write-write dependences.  */
-      if (!DR_IS_READ (dra) && !DR_IS_READ (drb))
+      if (DR_IS_WRITE (dra) && DR_IS_WRITE (drb))
         return true;
 
       /* Check if this dependence is allowed in basic block vectorization.  */ 
@@ -1553,7 +1554,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
                       dr0 = dr;
                     }
 
-                  if (!first_store && !DR_IS_READ (dr))
+                  if (!first_store && DR_IS_WRITE (dr))
                     first_store = dr;
                 }
 
@@ -1565,7 +1566,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
               if (!supportable_dr_alignment)
                 {
                   dr0 = dr;
-                  if (!first_store && !DR_IS_READ (dr))
+                  if (!first_store && DR_IS_WRITE (dr))
                     first_store = dr;
                 }
             }
@@ -2078,7 +2079,7 @@ vect_analyze_group_access (struct data_reference *dr)
                                      DR_INIT (STMT_VINFO_DATA_REF (
                                                   vinfo_for_stmt (next)))))
             {
-              if (!DR_IS_READ (data_ref))
+              if (DR_IS_WRITE (data_ref))
                 {
                   if (vect_print_dump_info (REPORT_DETAILS))
                     fprintf (vect_dump, "Two store stmts share the same dr.");
@@ -2123,7 +2124,7 @@ vect_analyze_group_access (struct data_reference *dr)
            {
              /* FORNOW: SLP of accesses with gaps is not supported.  */
              slp_impossible = true;
-             if (!DR_IS_READ (data_ref))
+             if (DR_IS_WRITE (data_ref))
                {
                  if (vect_print_dump_info (REPORT_DETAILS))
                    fprintf (vect_dump, "interleaved store with gaps");
@@ -2215,7 +2216,7 @@ vect_analyze_group_access (struct data_reference *dr)
 
       /* SLP: create an SLP data structure for every interleaving group of
         stores for further analysis in vect_analyse_slp.  */
-      if (!DR_IS_READ (dr) && !slp_impossible)
+      if (DR_IS_WRITE (dr) && !slp_impossible)
         {
           if (loop_vinfo)
             VEC_safe_push (gimple, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo),
@@ -2541,6 +2542,17 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
       offset = unshare_expr (DR_OFFSET (dr));
       init = unshare_expr (DR_INIT (dr));
 
+      if (stmt_could_throw_p (stmt))
+        {
+          if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+            {
+              fprintf (vect_dump, "not vectorized: statement can throw an "
+                       "exception ");
+              print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+            }
+          return false;
+        }
+
       /* Update DR field in stmt_vec_info struct.  */
 
       /* If the dataref is in an inner-loop of the loop that is considered for