https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64003
--- Comment #5 from dmalcolm at gcc dot gnu.org --- Running valgrind with --track-origins=yes shows: ==9952== Uninitialised value was created by a heap allocation ==9952== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9952== by 0x12BF3B7: xmalloc (xmalloc.c:147) ==9952== by 0x7876A4: shorten_branches(rtx_insn*) (final.c:1022) ==9952== by 0x787F5F: (anonymous namespace)::pass_shorten_branches::execute(function*) (final.c:4567) ==9952== by 0x994581: execute_one_pass(opt_pass*) (passes.c:2269) ==9952== by 0x994B95: execute_pass_list_1(opt_pass*) (passes.c:2321) ==9952== by 0x994BA7: execute_pass_list_1(opt_pass*) (passes.c:2322) ==9952== by 0x994BA7: execute_pass_list_1(opt_pass*) (passes.c:2322) ==9952== by 0x994BE8: execute_pass_list(function*, opt_pass*) (passes.c:2332) ==9952== by 0x6B87E3: cgraph_node::expand() (cgraphunit.c:1773) ==9952== by 0x6B9DB8: symbol_table::compile() (cgraphunit.c:1909) ==9952== by 0x6BB69C: symbol_table::finalize_compilation_unit() (cgraphunit.c:2325) specifically, it's reading uninitialized data from the insn_lengths array allocated here: insn_lengths = XNEWVEC (int, max_uid);