re PR tree-optimization/33373 (ICE in vectorizable_type_demotion, at tree-vect-transf...
authorDorit Nuzman <dorit@il.ibm.com>
Wed, 12 Sep 2007 07:09:38 +0000 (07:09 +0000)
committerDorit Nuzman <dorit@gcc.gnu.org>
Wed, 12 Sep 2007 07:09:38 +0000 (07:09 +0000)
        PR tree-optimization/33373
        * tree-vect-analyze (vect_determine_vectorization_factor): Call
        TREE_INT_CST_LOW when comparing TYPE_SIZE_UNIT.

From-SVN: r128415

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr33373.c [new file with mode: 0644]
gcc/tree-vect-analyze.c

index e74a823d47c9e2f44b6e3352345009231796f83c..049e6b6379812badcf5e7277a72dd8d2f28741c3 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-12  Dorit Nuzman  <dorit@il.ibm.com>
+
+       PR tree-optimization/33373
+       * tree-vect-analyze (vect_determine_vectorization_factor): Call 
+       TREE_INT_CST_LOW when comparing TYPE_SIZE_UNIT. 
+
 2007-09-12  Jan Hubicka  <jh@suse.cz>
 
        PR target/33393
index e0525892e03e3b3c2cb3170d9b0e0c4505c06bef..894533aee5702e465f793b163592024aed72b9f6 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-12  Dorit Nuzman  <dorit@il.ibm.com>
+
+       PR tree-optimization/33373
+       * gcc.dg/vect/pr33373.c: New test.
+
 2007-09-12  Ben Elliston  <bje@au.ibm.com>
 
        * lib/target-supports.exp (check_effective_target_vect_no_double):
diff --git a/gcc/testsuite/gcc.dg/vect/pr33373.c b/gcc/testsuite/gcc.dg/vect/pr33373.c
new file mode 100644 (file)
index 0000000..b11cfb4
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+void DOSMEM_FillIsrTable(int*isr) {
+    int i;
+
+    for (i=0; i<256; i++)
+        isr[i]=(((short)((i*4) & 0xFFFF)) | (0xf000 & 0xFFFF) << 16);
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
index 557bf2fb47046bee375b2f573e16210915ac5518..51f0294779d18b46d44cea813d9643af38ae79dd 100644 (file)
@@ -242,11 +242,12 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
              operation = GIMPLE_STMT_OPERAND (stmt, 1);
              if (TREE_CODE (operation) == NOP_EXPR
                  || TREE_CODE (operation) == CONVERT_EXPR
-                 || TREE_CODE (operation) ==  WIDEN_MULT_EXPR)
+                 || TREE_CODE (operation) == WIDEN_MULT_EXPR)
                {
                  tree rhs_type = TREE_TYPE (TREE_OPERAND (operation, 0));
-                 if (TYPE_SIZE_UNIT (rhs_type) < TYPE_SIZE_UNIT (scalar_type))
-                   scalar_type = TREE_TYPE (TREE_OPERAND (operation, 0));
+                 if (TREE_INT_CST_LOW (TYPE_SIZE_UNIT (rhs_type)) < 
+                     TREE_INT_CST_LOW (TYPE_SIZE_UNIT (scalar_type)))
+                   scalar_type = rhs_type;
                }
 
              if (vect_print_dump_info (REPORT_DETAILS))