aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-02-12 21:29:39 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-02-12 21:29:39 +0000
commit8665227f25053105244d452d86fbfa9b5f7b174d (patch)
tree0f95564f0bc325d0f52fc5b75d1db05e8b55ba23 /gcc
parent8f768a5a18a47ce412c6455a6e802d4b703fcf26 (diff)
downloadgcc-8665227f25053105244d452d86fbfa9b5f7b174d.zip
gcc-8665227f25053105244d452d86fbfa9b5f7b174d.tar.gz
gcc-8665227f25053105244d452d86fbfa9b5f7b174d.tar.bz2
re PR tree-optimization/35171 (ICE in vect_recog_dot_prod_pattern)
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr35171.c10
-rw-r--r--gcc/tree-vect-patterns.c9
4 files changed, 25 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 61d1567..9369e6d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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
* fold-const.c (fold_widened_comparison): Use get_unwidened in
value-preserving mode. Disallow final truncation.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 00a713e..cf0c854 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
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
* gcc.c-torture/execute/pr35163.c: New testcase.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35171.c b/gcc/testsuite/gcc.c-torture/compile/pr35171.c
new file mode 100644
index 0000000..3f7ef2c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr35171.c
@@ -0,0 +1,10 @@
+int f(int a, int b, short c, int d, short e)
+{
+ int i;
+ for (i = 1; i <= 2 ; i++) {
+ c -= 4;
+ a = c;
+ d = d + (b?b:e);
+ }
+ return a + d;
+}
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 24a0e5d..c1ce14c 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -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;