]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR tree-optimization/50650
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Oct 2011 11:48:03 +0000 (11:48 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Oct 2011 11:48:03 +0000 (11:48 +0000)
* tree-vect-patterns.c (vect_recog_mixed_size_cond_pattern): Don't
call vect_is_simple_cond here, instead fail if cond_expr isn't
COMPARISON_CLASS_P or if get_vectype_for_scalar_type returns NULL
for cond_expr's first operand.
* tree-vect-stmts.c (vect_is_simple_cond): Static again.
* tree-vectorizer.h (vect_is_simple_cond): Remove prototype.

* gcc.c-torture/compile/pr50650.c: New test.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr50650.c [new file with mode: 0644]
gcc/tree-vect-patterns.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.h

index 474b1c8aa677620c0c839e06a4cf15be6660d958..9d0991ea38104bb3862194573d5b319801578943 100644 (file)
@@ -1,3 +1,13 @@
+2011-10-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/50650
+       * tree-vect-patterns.c (vect_recog_mixed_size_cond_pattern): Don't
+       call vect_is_simple_cond here, instead fail if cond_expr isn't
+       COMPARISON_CLASS_P or if get_vectype_for_scalar_type returns NULL
+       for cond_expr's first operand.
+       * tree-vect-stmts.c (vect_is_simple_cond): Static again.
+       * tree-vectorizer.h (vect_is_simple_cond): Remove prototype.
+
 2011-10-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * config/s390/s390.md (DWH, dwh): New mode macros.
index f558333902cce7ee91133070291adc9abf997d4e..7597cd2443ee6803b92e336bf44421b36e301a8d 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/50650
+       * gcc.c-torture/compile/pr50650.c: New test.
+
 2011-10-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR tree-optimization/50575
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr50650.c b/gcc/testsuite/gcc.c-torture/compile/pr50650.c
new file mode 100644 (file)
index 0000000..6c443e6
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR tree-optimization/50650 */
+
+unsigned int
+foo (unsigned int x, unsigned int y)
+{
+  int i;
+  for (i = 8; i--; x <<= 1)
+    y ^= (x ^ y) & 0x80 ? 79U : 0U;
+  return y;
+}
index 0cd350d2dca1b29f55b955c5970a7eed22c33d5e..a47b87b6f1c63a2cf6eeaa610cef807ab6b151ac 100644 (file)
@@ -1269,8 +1269,12 @@ vect_recog_mixed_size_cond_pattern (VEC (gimple, heap) **stmts, tree *type_in,
       || TREE_CODE (else_clause) != INTEGER_CST)
     return NULL;
 
-  if (!vect_is_simple_cond (cond_expr, loop_vinfo, &comp_vectype)
-      || !comp_vectype)
+  if (!COMPARISON_CLASS_P (cond_expr))
+    return NULL;
+
+  comp_vectype
+    = get_vectype_for_scalar_type (TREE_TYPE (TREE_OPERAND (cond_expr, 0)));
+  if (comp_vectype == NULL_TREE)
     return NULL;
 
   type = gimple_expr_type (last_stmt);
index 2110c9601573c700389ddb445c9d1b36c9b99f65..f2ac8c7a6168bf45a480583a3c3d4b519943c48b 100644 (file)
@@ -4698,7 +4698,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
    Returns whether a COND can be vectorized.  Checks whether
    condition operands are supportable using vec_is_simple_use.  */
 
-bool
+static bool
 vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo, tree *comp_vectype)
 {
   tree lhs, rhs;
index 27820820bd5be03bd80189011fd4ab5e86eb6886..f22add6b754f925e6a872e95ac323001237b218f 100644 (file)
@@ -818,7 +818,6 @@ extern bool vect_transform_stmt (gimple, gimple_stmt_iterator *,
                                  bool *, slp_tree, slp_instance);
 extern void vect_remove_stores (gimple);
 extern bool vect_analyze_stmt (gimple, bool *, slp_tree);
-extern bool vect_is_simple_cond (tree, loop_vec_info, tree *);
 extern bool vectorizable_condition (gimple, gimple_stmt_iterator *, gimple *,
                                     tree, int);
 extern void vect_get_load_cost (struct data_reference *, int, bool,