tree-vect-loop.c (vectorizable_reduction): Check reduction cost before setting STMT_V...
authorRichard Sandiford <richard.sandiford@linaro.org>
Wed, 4 May 2011 13:09:26 +0000 (13:09 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 4 May 2011 13:09:26 +0000 (13:09 +0000)
gcc/
* tree-vect-loop.c (vectorizable_reduction): Check reduction cost
before setting STMT_VINFO_TYPE.

From-SVN: r173373

gcc/ChangeLog
gcc/tree-vect-loop.c

index 523dd67836d9a9590feb31637c1f4c027f447e43..eb6d38c6ade1a06fefe11c6bd6905edc7fcbd5d9 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-04  Richard Sandiford  <richard.sandiford@linaro.org>
+
+       * tree-vect-loop.c (vectorizable_reduction): Check reduction cost
+       before setting STMT_VINFO_TYPE.
+
 2011-05-04  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
        * config/spu/spu.c (spu_gimplify_va_arg_expr): Call pass_by_reference
index e05c324d0b944b6041f046db5cef4783c0ecd4fd..8f3b8e61c642c5142f2baef4cf2d33f235660b8a 100644 (file)
@@ -4317,9 +4317,9 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
 
   if (!vec_stmt) /* transformation not required.  */
     {
-      STMT_VINFO_TYPE (stmt_info) = reduc_vec_info_type;
       if (!vect_model_reduction_cost (stmt_info, epilog_reduc_code, ncopies))
         return false;
+      STMT_VINFO_TYPE (stmt_info) = reduc_vec_info_type;
       return true;
     }