diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-21 08:24:13 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-21 08:24:13 +0000 |
commit | a67f43dbcbb3ada626118f180252dfcbf2744812 (patch) | |
tree | 42bc6c290411588a59e520cb9ff7360e274fcf45 /gcc | |
parent | 6e5b1d3ad2edccacc59dec640ff0be5424defb44 (diff) | |
download | gcc-a67f43dbcbb3ada626118f180252dfcbf2744812.tar.gz |
PR debug/66432
* tree-inline.c (copy_debug_stmt): If
gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL
in decl_debug_args, don't call remap_gimple_op_r on it.
* gcc.dg/debug/pr66432.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230702 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/pr66432.c | 19 | ||||
-rw-r--r-- | gcc/tree-inline.c | 7 |
4 files changed, 35 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b7c5d23822..9bc928f1cf0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-11-21 Jakub Jelinek <jakub@redhat.com> + + PR debug/66432 + * tree-inline.c (copy_debug_stmt): If + gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL + in decl_debug_args, don't call remap_gimple_op_r on it. + 2015-11-07 Jan Hubicka <hubicka@ucw.cz> * ipa-icf.c (sem_item::add_type): Do not look for TYPE_CANONICAL; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eca66283285..8eaa6574829 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-21 Jakub Jelinek <jakub@redhat.com> + + PR debug/66432 + * gcc.dg/debug/pr66432.c: New test. + 2015-11-20 Ian Lance Taylor <iant@google.com> PR go/66406 diff --git a/gcc/testsuite/gcc.dg/debug/pr66432.c b/gcc/testsuite/gcc.dg/debug/pr66432.c new file mode 100644 index 00000000000..cf36799f3aa --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/pr66432.c @@ -0,0 +1,19 @@ +/* PR debug/66432 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g" } */ + +extern void baz (const char *, const char *) __attribute__ ((__noreturn__)); + +void +foo (int x, int y[x][x]) +{ + if (x < 2) + baz ("", ""); +} + +void +bar (void) +{ + int z[2][2] = { { 1, 2 }, { 3, 4 } }; + foo (2, z); +} diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 205c869b88e..ebab1898fad 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2864,8 +2864,6 @@ copy_debug_stmt (gdebug *stmt, copy_body_data *id) else if (gimple_debug_source_bind_p (stmt)) { gimple_debug_source_bind_set_var (stmt, t); - walk_tree (gimple_debug_source_bind_get_value_ptr (stmt), - remap_gimple_op_r, &wi, NULL); /* When inlining and source bind refers to one of the optimized away parameters, change the source bind into normal debug bind referring to the corresponding DEBUG_EXPR_DECL that should have @@ -2889,7 +2887,10 @@ copy_debug_stmt (gdebug *stmt, copy_body_data *id) break; } } - } + } + if (gimple_debug_source_bind_p (stmt)) + walk_tree (gimple_debug_source_bind_get_value_ptr (stmt), + remap_gimple_op_r, &wi, NULL); } processing_debug_stmt = 0; |