]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-vectorizer.c (vect_analyze_offset_expr): Strip conversions that don't narrow...
authorRichard Henderson <rth@redhat.com>
Sun, 2 Jan 2005 08:35:34 +0000 (00:35 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 2 Jan 2005 08:35:34 +0000 (00:35 -0800)
        * tree-vectorizer.c (vect_analyze_offset_expr): Strip conversions
        that don't narrow the value.  Fail for other conversions.

From-SVN: r92804

gcc/ChangeLog
gcc/tree-vectorizer.c

index 0ebb6696b5dfb30f2b4a3f57e5295ce98c24810c..20b6d358e3bec881cad211f3aad38227d9ebc17c 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-01  Richard Henderson  <rth@redhat.com>
+
+       * tree-vectorizer.c (vect_analyze_offset_expr): Strip conversions
+       that don't narrow the value.  Fail for other conversions.
+
 2005-01-01  Richard Henderson  <rth@redhat.com>
 
        PR c/19031
index 5df56dfc93cf36c60d243349e5136336f033cc1d..bd826d0127c659c91bc20644e3eb37c397c90f93 100644 (file)
@@ -1390,7 +1390,22 @@ vect_analyze_offset_expr (tree expr,
   enum tree_code code;
   tree init, evolution, def_stmt;
 
-  STRIP_NOPS (expr);
+  /* Strip conversions that don't narrow the mode.  */
+  while (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) == CONVERT_EXPR)
+    {
+      tree to, ti;
+
+      to = TREE_TYPE (expr);
+      oprnd0 = TREE_OPERAND (expr, 0);
+      ti = TREE_TYPE (oprnd0);
+
+      if (!INTEGRAL_TYPE_P (to) || !INTEGRAL_TYPE_P (ti))
+       return false;
+      if (GET_MODE_SIZE (TYPE_MODE (to)) < GET_MODE_SIZE (TYPE_MODE (ti)))
+       return false;
+
+      expr = oprnd0;
+    }
   
   *step = NULL_TREE;
   *misalign = NULL_TREE;