OSDN Git Service

gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 May 2011 13:09:26 +0000 (13:09 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 May 2011 13:09:26 +0000 (13:09 +0000)
* tree-vect-loop.c (vectorizable_reduction): Check reduction cost
before setting STMT_VINFO_TYPE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173373 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 523dd67..eb6d38c 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 e05c324..8f3b8e6 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;
     }