OSDN Git Service

* tree-vectorizer.c (vect_analyze_offset_expr): Strip conversions
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 Jan 2005 08:35:34 +0000 (08:35 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 Jan 2005 08:35:34 +0000 (08:35 +0000)
        that don't narrow the value.  Fail for other conversions.

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

gcc/ChangeLog
gcc/tree-vectorizer.c

index 0ebb669..20b6d35 100644 (file)
@@ -1,5 +1,10 @@
 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
        * c-decl.c (pop_file_scope): Call maybe_apply_pending_pragma_weaks.
        * c-lang.c (finish_file): Don't do it here.
index 5df56df..bd826d0 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;