aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-in.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2017-12-11 16:13:53 +0000
committerAndi Kleen <ak@gcc.gnu.org>2017-12-11 16:13:53 +0000
commitad3f54ab8e70aba72eb278d12d5e3c5d8b0de912 (patch)
tree282ac512ba37da0ef146f2f06023ddd149dd17e4 /gcc/lto-streamer-in.c
parent46bb9d29d3017715a7dbb9477612aff06f8c0994 (diff)
downloadgcc-ad3f54ab8e70aba72eb278d12d5e3c5d8b0de912.zip
gcc-ad3f54ab8e70aba72eb278d12d5e3c5d8b0de912.tar.gz
gcc-ad3f54ab8e70aba72eb278d12d5e3c5d8b0de912.tar.bz2
Fix stack overflow with autofdo (PR83355)
g++.dg/bprob* is failing currently with autofdo. Running in gdb shows that there is a very deep recursion in get_index_by_decl until it overflows the stack. gcc/: 2017-12-11 Andi Kleen <ak@linux.intel.com> PR gcov-profile/83355 * auto-profile.c (string_table::get_index_by_decl): Don't recurse when abstract origin points to itself. From-SVN: r255540
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r--gcc/lto-streamer-in.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index fd6bd06..3db1d38 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -360,6 +360,8 @@ lto_input_tree_ref (struct lto_input_block *ib, struct data_in *data_in,
case LTO_label_decl_ref:
case LTO_translation_unit_decl_ref:
case LTO_namelist_decl_ref:
+ if (!data_in->file_data->current_decl_state)
+ printf("tag %d\n", tag);
ix_u = streamer_read_uhwi (ib);
result = lto_file_decl_data_get_var_decl (data_in->file_data, ix_u);
break;