From 8318d4ce56634f309a5d47da92ba4fccb72fec15 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 13 Dec 2012 00:19:32 +0100 Subject: re PR debug/55665 (Missing DW_TAG_lexical_block PC range) PR debug/55665 * tree-inline.c (remap_decls): Change nonlocalized_list to pointer to pointer to vector from pointer to vector. (remap_block): Pass address of BLOCK_NONLOCALIZED_VARS. * g++.dg/guality/pr55665.C: New test. From-SVN: r194461 --- gcc/ChangeLog | 5 +++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/guality/pr55665.C | 33 +++++++++++++++++++++++++++++++++ gcc/tree-inline.c | 8 ++++---- 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/guality/pr55665.C (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d5dbe0..bb26702 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2012-12-12 Jakub Jelinek + PR debug/55665 + * tree-inline.c (remap_decls): Change nonlocalized_list + to pointer to pointer to vector from pointer to vector. + (remap_block): Pass address of BLOCK_NONLOCALIZED_VARS. + PR sanitizer/55508 * builtin-attrs.def (ATTR_TMPURE_NOTHROW_LEAF_LIST, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST): New. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 80981f6..e9b645d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2012-12-12 Jakub Jelinek + PR debug/55665 + * g++.dg/guality/pr55665.C: New test. + * lib/gcc-dg.exp (${tool}_load): Handle non-existing set_target_env_var the same as if it is empty list. (dg-set-target-env-var): Fix up error message. diff --git a/gcc/testsuite/g++.dg/guality/pr55665.C b/gcc/testsuite/g++.dg/guality/pr55665.C new file mode 100644 index 0000000..16c6d28 --- /dev/null +++ b/gcc/testsuite/g++.dg/guality/pr55665.C @@ -0,0 +1,33 @@ +// PR debug/55655 +// { dg-do run } +// { dg-options "-g" } + +extern "C" void abort (); +struct A { A (int); int a; }; + +__attribute__((noinline, noclone)) int +bar (void) +{ + return 40; +} + +__attribute__((noinline, noclone)) void +foo (int x) +{ + __asm volatile ("" : : "r" (x) : "memory"); +} + +A::A (int x) +{ + static int p = bar (); + foo (p); // { dg-final { gdb-test 23 "p" "40" } } + a = ++p; +} + +int +main () +{ + A a (42); + if (a.a != 41) + abort (); +} diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index a06d7b9..70aa567 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -536,7 +536,7 @@ can_be_nonlocal (tree decl, copy_body_data *id) } static tree -remap_decls (tree decls, vec *nonlocalized_list, +remap_decls (tree decls, vec **nonlocalized_list, copy_body_data *id) { tree old_var; @@ -557,7 +557,7 @@ remap_decls (tree decls, vec *nonlocalized_list, if ((!optimize || debug_info_level > DINFO_LEVEL_TERSE) && !DECL_IGNORED_P (old_var) && nonlocalized_list) - vec_safe_push (nonlocalized_list, old_var); + vec_safe_push (*nonlocalized_list, old_var); continue; } @@ -575,7 +575,7 @@ remap_decls (tree decls, vec *nonlocalized_list, if ((!optimize || debug_info_level > DINFO_LEVEL_TERSE) && !DECL_IGNORED_P (old_var) && nonlocalized_list) - vec_safe_push (nonlocalized_list, old_var); + vec_safe_push (*nonlocalized_list, old_var); } else { @@ -622,7 +622,7 @@ remap_block (tree *block, copy_body_data *id) /* Remap its variables. */ BLOCK_VARS (new_block) = remap_decls (BLOCK_VARS (old_block), - BLOCK_NONLOCALIZED_VARS (new_block), + &BLOCK_NONLOCALIZED_VARS (new_block), id); if (id->transform_lang_insert_block) -- cgit v1.1