IPA: fix one more UBSAN error
authorMartin Liska <mliska@suse.cz>
Mon, 19 Oct 2020 08:52:53 +0000 (10:52 +0200)
committerMartin Liska <mliska@suse.cz>
Mon, 19 Oct 2020 12:02:36 +0000 (14:02 +0200)
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<int>::merge(modref_tree<int>*, vec<modref_parm_map, va_heap, vl_ptr>*) /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<cgraph_edge*, va_heap, vl_ptr>*, 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

index 8e6a87643ecce490a682b179850759c069abc66b..3a70965d15676e6da4e32819e338dcb8126d1155 100644 (file)
@@ -1654,7 +1654,7 @@ compute_parm_map (cgraph_edge *callee_edge, vec<modref_parm_map> *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++)
        {