summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-16 11:33:45 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-16 11:33:45 +0000
commit9ec77f4dfca2518dea4784abf96b70d7d73dada1 (patch)
treeb62a2f40c7d39797a2ba9915118b892b93c7ed00
parent35af01889aa8a9281e2c7addfedfaae568822c75 (diff)
downloadgcc-9ec77f4dfca2518dea4784abf96b70d7d73dada1.tar.gz
PR tree-optimization/42917
* lambda-code.c (remove_iv): Skip debug statements. (lambda_loopnest_to_gcc_loopnest): Likewise. (not_interesting_stmt): Debug statements are not interesting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157477 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/lambda-code.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr42917.c16
3 files changed, 30 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f35a7a7b6bf..fda7e80c4b1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-16 Aldy Hernandez <aldyh@redhat.com>
+ Alexandre Oliva <aoliva@redhat.com>
+
+ PR tree-optimization/42917
+ * lambda-code.c (remove_iv): Skip debug statements.
+ (lambda_loopnest_to_gcc_loopnest): Likewise.
+ (not_interesting_stmt): Debug statements are not interesting.
+
2010-03-16 Jakub Jelinek <jakub@redhat.com>
PR debug/43051
diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c
index e5fe6299f28..50f7d475665 100644
--- a/gcc/lambda-code.c
+++ b/gcc/lambda-code.c
@@ -1657,7 +1657,7 @@ remove_iv (gimple iv_stmt)
continue;
FOR_EACH_IMM_USE_STMT (stmt, imm_iter, arg)
- if (stmt != iv_stmt)
+ if (stmt != iv_stmt && !is_gimple_debug (stmt))
used = true;
if (!used)
@@ -1839,6 +1839,9 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
gimple_seq stmts;
lambda_body_vector lbv, newlbv;
+ if (is_gimple_debug (stmt))
+ continue;
+
/* Compute the new expression for the induction
variable. */
depth = VEC_length (tree, new_ivs);
@@ -1885,7 +1888,8 @@ not_interesting_stmt (gimple stmt)
loop, we would have already failed the number of exits tests. */
if (gimple_code (stmt) == GIMPLE_LABEL
|| gimple_code (stmt) == GIMPLE_GOTO
- || gimple_code (stmt) == GIMPLE_COND)
+ || gimple_code (stmt) == GIMPLE_COND
+ || is_gimple_debug (stmt))
return true;
return false;
}
diff --git a/gcc/testsuite/gcc.dg/pr42917.c b/gcc/testsuite/gcc.dg/pr42917.c
new file mode 100644
index 00000000000..d8db32ea2da
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr42917.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-loop-linear -fcompare-debug -fdump-tree-ltrans" } */
+
+extern int A[];
+
+void
+foo ()
+{
+ int i, j;
+ for (i = 0; i < 4; i++)
+ for (j = 255; j >= 0; j--)
+ A[j] = 0;
+}
+
+/* { dg-final { scan-tree-dump "Successfully transformed loop" "ltrans" } } */
+/* { dg-final { cleanup-tree-dump "ltrans" } } */