diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-11-07 08:50:01 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-11-07 08:50:01 +0100 |
commit | 6e02b5f509bc80b1fde3abbf8d09bb19a408a7ff (patch) | |
tree | d0a69bc67491e1470eb38fcc87f4662b22addf51 /gcc | |
parent | 4c166488ff7cfbe253af1a062371c211667b1db1 (diff) | |
download | gcc-6e02b5f509bc80b1fde3abbf8d09bb19a408a7ff.zip gcc-6e02b5f509bc80b1fde3abbf8d09bb19a408a7ff.tar.gz gcc-6e02b5f509bc80b1fde3abbf8d09bb19a408a7ff.tar.bz2 |
re PR debug/54693 (VTA guality issues with loops)
PR debug/54693
* tree-flow.h (propagate_threaded_block_debug_into): New prototype.
* tree-ssa-threadedge.c (propagate_threaded_block_debug_into): No
longer static.
* tree-ssa-loop-ch.c (copy_loop_headers): Use it.
* gcc.dg/guality/pr54693-2.c: New test.
From-SVN: r193281
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/guality/pr54693-2.c | 33 | ||||
-rw-r--r-- | gcc/tree-flow.h | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ch.c | 3 | ||||
-rw-r--r-- | gcc/tree-ssa-threadedge.c | 4 |
6 files changed, 53 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c73a7fd..ee47cec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2012-11-07 Jakub Jelinek <jakub@redhat.com> + + PR debug/54693 + * tree-flow.h (propagate_threaded_block_debug_into): New prototype. + * tree-ssa-threadedge.c (propagate_threaded_block_debug_into): No + longer static. + * tree-ssa-loop-ch.c (copy_loop_headers): Use it. + 2012-11-06 Sterling Augustine <saugustine@google.com> * dwarf2out.c (output_comdat_type_unit): Check for OBJECT_FORMAT_ELF. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b2fc1b4..8c5d5f3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-11-07 Jakub Jelinek <jakub@redhat.com> + + PR debug/54693 + * gcc.dg/guality/pr54693-2.c: New test. + 2012-11-06 Andrew Pinski <apinski@cavium.com> * gcc.target/aarch64/vect-fmaxv-fminv-compile.c: Add -fno-vect-cost-model. diff --git a/gcc/testsuite/gcc.dg/guality/pr54693-2.c b/gcc/testsuite/gcc.dg/guality/pr54693-2.c new file mode 100644 index 0000000..2810a75 --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr54693-2.c @@ -0,0 +1,33 @@ +/* PR debug/54693 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ + +int v; + +__attribute__((noinline, noclone)) void +bar (int i) +{ + v = i; + asm volatile ("" : : "r" (i) : "memory"); +} + +__attribute__((noinline, noclone)) void +foo (int x, int y, int z) +{ + int i = 0; + while (x > 3 && y > 3 && z > 3) + { /* { dg-final { gdb-test 21 "i" "v + 1" } } */ + /* { dg-final { gdb-test 21 "x" "10 - i" } } */ + bar (i); /* { dg-final { gdb-test 21 "y" "20 - 2 * i" } } */ + /* { dg-final { gdb-test 21 "z" "30 - 3 * i" } } */ + i++, x--, y -= 2, z -= 3; + } +} + +int +main () +{ + v = -1; + foo (10, 20, 30); + return 0; +} diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 0d9edad..7c27d96 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -1,6 +1,6 @@ /* Data and Control Flow Analysis for Trees. - Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, + 2012 Free Software Foundation, Inc. Contributed by Diego Novillo <dnovillo@redhat.com> This file is part of GCC. @@ -689,6 +689,7 @@ extern void set_ssa_name_value (tree, tree); extern bool potentially_threadable_block (basic_block); extern void thread_across_edge (gimple, edge, bool, VEC(tree, heap) **, tree (*) (gimple, gimple)); +extern void propagate_threaded_block_debug_into (basic_block, basic_block); /* In tree-ssa-loop-im.c */ /* The possibilities of statement movement. */ diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c index 7afcc91..02f6a41 100644 --- a/gcc/tree-ssa-loop-ch.c +++ b/gcc/tree-ssa-loop-ch.c @@ -1,5 +1,5 @@ /* Loop header copying on trees. - Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -197,6 +197,7 @@ copy_loop_headers (void) entry = loop_preheader_edge (loop); + propagate_threaded_block_debug_into (exit->dest, entry->dest); if (!gimple_duplicate_sese_region (entry, exit, bbs, n_bbs, copied_bbs)) { fprintf (dump_file, "Duplication failed.\n"); diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 76b91b7..64e42f3 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -1,5 +1,5 @@ /* SSA Jump Threading - Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 + Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. Contributed by Jeff Law <law@redhat.com> @@ -617,7 +617,7 @@ DEF_VEC_ALLOC_O_STACK(tree); /* Copy debug stmts from DEST's chain of single predecessors up to SRC, so that we don't lose the bindings as PHI nodes are introduced when DEST gains new predecessors. */ -static void +void propagate_threaded_block_debug_into (basic_block dest, basic_block src) { if (!MAY_HAVE_DEBUG_STMTS) |