aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2011-06-04 18:20:36 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2011-06-04 16:20:36 +0000
commit26740835ec4e0049bf26b98cea017e1d9ce888b0 (patch)
tree08154b04ddcdd9c66f3ff68d546a4ce4f075c4d5 /gcc/lto-cgraph.c
parent014ab419efc12a59efebd2720d79e1c055675c85 (diff)
downloadgcc-26740835ec4e0049bf26b98cea017e1d9ce888b0.zip
gcc-26740835ec4e0049bf26b98cea017e1d9ce888b0.tar.gz
gcc-26740835ec4e0049bf26b98cea017e1d9ce888b0.tar.bz2
re PR lto/48954 (ICE: SIGSEGV in bitmap_count_bits (bitmap.c:719) with -O2 -flto -fno-early-inlining -fkeep-inline-functions)
PR lto/48954 * lto-cgraph.c (output_node_opt_summary): Handle NULL skip args bitmaps. * g++.dg/torture/pr48954.C: New testcase. From-SVN: r174644
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 1d2f92e..3b1115b 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -1598,14 +1598,24 @@ output_node_opt_summary (struct output_block *ob,
int i;
struct cgraph_edge *e;
- lto_output_uleb128_stream (ob->main_stream,
- bitmap_count_bits (node->clone.args_to_skip));
- EXECUTE_IF_SET_IN_BITMAP (node->clone.args_to_skip, 0, index, bi)
- lto_output_uleb128_stream (ob->main_stream, index);
- lto_output_uleb128_stream (ob->main_stream,
- bitmap_count_bits (node->clone.combined_args_to_skip));
- EXECUTE_IF_SET_IN_BITMAP (node->clone.combined_args_to_skip, 0, index, bi)
- lto_output_uleb128_stream (ob->main_stream, index);
+ if (node->clone.args_to_skip)
+ {
+ lto_output_uleb128_stream (ob->main_stream,
+ bitmap_count_bits (node->clone.args_to_skip));
+ EXECUTE_IF_SET_IN_BITMAP (node->clone.args_to_skip, 0, index, bi)
+ lto_output_uleb128_stream (ob->main_stream, index);
+ }
+ else
+ lto_output_uleb128_stream (ob->main_stream, 0);
+ if (node->clone.combined_args_to_skip)
+ {
+ lto_output_uleb128_stream (ob->main_stream,
+ bitmap_count_bits (node->clone.combined_args_to_skip));
+ EXECUTE_IF_SET_IN_BITMAP (node->clone.combined_args_to_skip, 0, index, bi)
+ lto_output_uleb128_stream (ob->main_stream, index);
+ }
+ else
+ lto_output_uleb128_stream (ob->main_stream, 0);
lto_output_uleb128_stream (ob->main_stream,
VEC_length (ipa_replace_map_p, node->clone.tree_map));
FOR_EACH_VEC_ELT (ipa_replace_map_p, node->clone.tree_map, i, map)