Commit 7a181764 by Aldy Hernandez Committed by Aldy Hernandez

re PR tree-optimization/42917 ("-fcompare-debug failure" with -ftree-loop-linear)

        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.


Co-Authored-By: Alexandre Oliva <aoliva@redhat.com>

From-SVN: r157477
parent 457eeaae
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> 2010-03-16 Jakub Jelinek <jakub@redhat.com>
PR debug/43051 PR debug/43051
......
...@@ -1657,7 +1657,7 @@ remove_iv (gimple iv_stmt) ...@@ -1657,7 +1657,7 @@ remove_iv (gimple iv_stmt)
continue; continue;
FOR_EACH_IMM_USE_STMT (stmt, imm_iter, arg) FOR_EACH_IMM_USE_STMT (stmt, imm_iter, arg)
if (stmt != iv_stmt) if (stmt != iv_stmt && !is_gimple_debug (stmt))
used = true; used = true;
if (!used) if (!used)
...@@ -1839,6 +1839,9 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, ...@@ -1839,6 +1839,9 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
gimple_seq stmts; gimple_seq stmts;
lambda_body_vector lbv, newlbv; lambda_body_vector lbv, newlbv;
if (is_gimple_debug (stmt))
continue;
/* Compute the new expression for the induction /* Compute the new expression for the induction
variable. */ variable. */
depth = VEC_length (tree, new_ivs); depth = VEC_length (tree, new_ivs);
...@@ -1885,7 +1888,8 @@ not_interesting_stmt (gimple stmt) ...@@ -1885,7 +1888,8 @@ not_interesting_stmt (gimple stmt)
loop, we would have already failed the number of exits tests. */ loop, we would have already failed the number of exits tests. */
if (gimple_code (stmt) == GIMPLE_LABEL if (gimple_code (stmt) == GIMPLE_LABEL
|| gimple_code (stmt) == GIMPLE_GOTO || gimple_code (stmt) == GIMPLE_GOTO
|| gimple_code (stmt) == GIMPLE_COND) || gimple_code (stmt) == GIMPLE_COND
|| is_gimple_debug (stmt))
return true; return true;
return false; return false;
} }
......
/* { 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" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment