Commit 61dc0ea7 by Alexandre Oliva Committed by Alexandre Oliva

re PR debug/54693 (VTA guality issues with loops)

gcc/ChangeLog:
PR debug/54693
* tree-ssa-threadedge.c (thread_around_empty_block): Copy
debug temps from predecessor before threading.
gcc/testsuite/ChangeLog:
PR debug/54693
* gcc.dg/guality/pr54693.c: New.

From-SVN: r192961
parent 6119d95c
2012-10-29 Alexandre Oliva <aoliva@redhat.com> 2012-10-29 Alexandre Oliva <aoliva@redhat.com>
PR debug/54693
* tree-ssa-threadedge.c (thread_around_empty_block): Copy
debug temps from predecessor before threading.
2012-10-29 Alexandre Oliva <aoliva@redhat.com>
PR debug/54551 PR debug/54551
PR debug/54693 PR debug/54693
* valtrack.c (dead_debug_global_find): Accept NULL dtemp. * valtrack.c (dead_debug_global_find): Accept NULL dtemp.
2012-10-29 Alexandre Oliva <aoliva@redhat.com>
PR debug/54693
* gcc.dg/guality/pr54693.c: New.
2012-10-29 Marc Glisse <marc.glisse@inria.fr> 2012-10-29 Marc Glisse <marc.glisse@inria.fr>
PR middle-end/55027 PR middle-end/55027
......
/* PR debug/54693 */
/* { dg-do run } */
/* { dg-options "-g" } */
__attribute__((noinline, noclone)) void
foo (char *str, char c)
{
asm volatile ("" : : "r" (str), "r" (c) : "memory");
*str = c;
}
int
main ()
{
int i;
char c;
char arr[11];
for (i = 0; i < 10; i++)
{
c = 0x30 + i;
foo (&arr[i], c); /* { dg-final { gdb-test 22 "i" "c - 48" } } */
}
__builtin_printf ("arr = %s\n", arr);
return 0;
}
...@@ -637,6 +637,24 @@ thread_around_empty_block (edge taken_edge, ...@@ -637,6 +637,24 @@ thread_around_empty_block (edge taken_edge,
if (!single_pred_p (bb)) if (!single_pred_p (bb))
return NULL; return NULL;
/* Before threading, copy DEBUG stmts from the predecessor, so that
we don't lose the bindings as we redirect the edges. */
if (MAY_HAVE_DEBUG_STMTS)
{
gsi = gsi_after_labels (bb);
for (gimple_stmt_iterator si = gsi_last_bb (taken_edge->src);
!gsi_end_p (si); gsi_prev (&si))
{
stmt = gsi_stmt (si);
if (!is_gimple_debug (stmt))
continue;
stmt = gimple_copy (stmt);
/* ??? Should we drop the location of the copy? */
gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
}
}
/* This block must have more than one successor. */ /* This block must have more than one successor. */
if (single_succ_p (bb)) if (single_succ_p (bb))
return NULL; return NULL;
......
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