From 11b8cca0831ee37cc534ff27cd8d32ac5aace6f7 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 19 Oct 2020 10:52:53 +0200 Subject: [PATCH] IPA: fix one more UBSAN error It fixes: /home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482:22: runtime error: load of value 255, which is not a valid value for type 'bool' #0 0x18e5df3 in modref_tree::merge(modref_tree*, vec*) /home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482 #1 0x18dc180 in ipa_merge_modref_summary_after_inlining(cgraph_edge*) /home/marxin/Programming/gcc2/gcc/ipa-modref.c:1779 #2 0x18c1c72 in inline_call(cgraph_edge*, bool, vec*, int*, bool, bool*) /home/marxin/Programming/gcc2/gcc/ipa-inline-transform.c:492 #3 0x4a3589c in inline_small_functions /home/marxin/Programming/gcc2/gcc/ipa-inline.c:2216 #4 0x4a3b230 in ipa_inline /home/marxin/Programming/gcc2/gcc/ipa-inline.c:2697 #5 0x4a3d902 in execute /home/marxin/Programming/gcc2/gcc/ipa-inline.c:3096 #6 0x1edf831 in execute_one_pass(opt_pass*) /home/marxin/Programming/gcc2/gcc/passes.c:2509 #7 0x1ee26af in execute_ipa_pass_list(opt_pass*) /home/marxin/Programming/gcc2/gcc/passes.c:2936 #8 0x103f31b in ipa_passes /home/marxin/Programming/gcc2/gcc/cgraphunit.c:2700 #9 0x103fb40 in symbol_table::compile() /home/marxin/Programming/gcc2/gcc/cgraphunit.c:2777 #10 0x104092b in symbol_table::finalize_compilation_unit() /home/marxin/Programming/gcc2/gcc/cgraphunit.c:3022 #11 0x235723b in compile_file /home/marxin/Programming/gcc2/gcc/toplev.c:485 #12 0x235fff9 in do_compile /home/marxin/Programming/gcc2/gcc/toplev.c:2321 #13 0x23605fc in toplev::main(int, char**) /home/marxin/Programming/gcc2/gcc/toplev.c:2460 #14 0x4e2b93b in main /home/marxin/Programming/gcc2/gcc/main.c:39 #15 0x7ffff6f0ae09 in __libc_start_main ../csu/libc-start.c:314 #16 0x9a0be9 in _start (/home/marxin/Programming/gcc2/objdir/gcc/cc1+0x9a0be9) gcc/ChangeLog: * ipa-modref.c (compute_parm_map): Clear vector. --- gcc/ipa-modref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index 8e6a87643ecce..3a70965d15676 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -1654,7 +1654,7 @@ compute_parm_map (cgraph_edge *callee_edge, vec *parm_map) : callee_edge->caller); callee_pi = IPA_NODE_REF (callee); - (*parm_map).safe_grow (count); + (*parm_map).safe_grow_cleared (count); for (i = 0; i < count; i++) {