]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/35171 (ICE in vect_recog_dot_prod_pattern)
authorRichard Guenther <rguenther@suse.de>
Tue, 12 Feb 2008 21:29:39 +0000 (21:29 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 12 Feb 2008 21:29:39 +0000 (21:29 +0000)
2008-02-12  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/35171
* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Deal with
default defs.

* gcc.c-torture/compile/pr35171.c: New testcase.

From-SVN: r132270

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

index 61d1567fa6d0105c3131d8e88a52e7686ef9ce9b..9369e6da4db0beef20d96b96b9e6b45e5b2dd06c 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-12  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/35171
+       * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Deal with
+       default defs.
+
 2008-02-12  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/35163
index 00a713e9941c759e6c40bc23ade073a44543dbdd..cf0c85455f62931d5302cb0bd90c24bf0fc70bde 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-12  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/35171
+       * gcc.c-torture/compile/pr35171.c: New testcase.
+
 2008-02-12  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/35163
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35171.c b/gcc/testsuite/gcc.c-torture/compile/pr35171.c
new file mode 100644 (file)
index 0000000..3f7ef2c
--- /dev/null
@@ -0,0 +1,10 @@
+int f(int a, int b, short c, int d, short e)\r
+{\r
+  int i;\r
+  for (i = 1; i <= 2 ; i++) {\r
+    c -= 4;\r
+    a = c;\r
+    d = d + (b?b:e);\r
+  }\r
+  return a + d;\r
+}\r
index 24a0e5de5ace09c95ee4fd9e1e61f5a94d7b544c..c1ce14c4bbb91b1aacf84d1b1a6fde43ff0fe11a 100644 (file)
@@ -246,15 +246,14 @@ vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
 
   prod_type = half_type;
   stmt = SSA_NAME_DEF_STMT (oprnd0);
-  gcc_assert (stmt);
+  /* FORNOW.  Can continue analyzing the def-use chain when this stmt in a phi 
+     inside the loop (in case we are analyzing an outer-loop).  */
+  if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+    return NULL; 
   stmt_vinfo = vinfo_for_stmt (stmt);
   gcc_assert (stmt_vinfo);
   if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_loop_def)
     return NULL;
-  /* FORNOW. Can continue analyzing the def-use chain when this stmt in a phi 
-     inside the loop (in case we are analyzing an outer-loop).  */
-  if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
-    return NULL; 
   expr = GIMPLE_STMT_OPERAND (stmt, 1);
   if (TREE_CODE (expr) != MULT_EXPR)
     return NULL;