aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.dg/pr50133.c18
-rw-r--r--gcc/tree-vect-stmts.c9
4 files changed, 26 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 14ab859..b0aaf46 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2011-08-22 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/50133
+ * tree-vect-stmts.c (vect_finish_stmt_generation): Copy location
+ from stmt instead of some statement around gsi.
+
PR middle-end/50141
* expr.c (get_bit_range): Only use DECL_THREAD_LOCAL_P if
innerdecl is a VAR_DECL.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 72feb20..67a5e89 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2011-08-22 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/50133
+ * gcc.dg/pr50133.c: New test.
+
PR middle-end/50141
* c-c++-common/cxxbitfields-6.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr50133.c b/gcc/testsuite/gcc.dg/pr50133.c
new file mode 100644
index 0000000..2c0f490
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr50133.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/50133 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -fno-tree-loop-im" } */
+
+extern int A[], B[];
+
+void
+foo (int z)
+{
+ int j, i;
+ for (j = 0; j < 32; j++)
+ {
+ int a = A[0];
+ for (i = 0; i < 16; i++)
+ a = A[i] ? a : z;
+ B[j] = a;
+ }
+}
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index c0ca2af..bab19b8 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -1419,7 +1419,6 @@ vect_finish_stmt_generation (gimple stmt, gimple vec_stmt,
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
- gimple_stmt_iterator si;
gcc_assert (gimple_code (stmt) != GIMPLE_LABEL);
@@ -1434,13 +1433,7 @@ vect_finish_stmt_generation (gimple stmt, gimple vec_stmt,
print_gimple_stmt (vect_dump, vec_stmt, 0, TDF_SLIM);
}
- si = *gsi;
- if (is_gimple_debug (gsi_stmt (si)))
- {
- gsi_next_nondebug (&si);
- gcc_assert (!gsi_end_p (si));
- }
- gimple_set_location (vec_stmt, gimple_location (gsi_stmt (si)));
+ gimple_set_location (vec_stmt, gimple_location (stmt));
}
/* Checks if CALL can be vectorized in type VECTYPE. Returns