rtl_dump_bb: fix segfault when reporting internal error
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 24 Nov 2020 21:47:11 +0000 (22:47 +0100)
committerIlya Leoshkevich <iii@linux.ibm.com>
Mon, 30 Nov 2020 10:50:30 +0000 (11:50 +0100)
commit4380d5ae721545f658d63f6df037afa5d7dc66a9
treecb497a586d1fc8fce9a3e4464e59b0812c9649d3
parente855b30c28391b190eebb8e6afc8d2116a6d85de
rtl_dump_bb: fix segfault when reporting internal error

During ICE reporting, sometimes rtl_dump_bb is called on partially
initialized basic blocks.  This produces another ICE, obscuring the
original problem.

Fix by checking that that basic blocks are initialized before touching
their bb_infos.

gcc/ChangeLog:

2020-11-25  Ilya Leoshkevich  <iii@linux.ibm.com>

* cfgrtl.c (rtl_bb_info_initialized_p): New function.
(rtl_dump_bb): Use rtl_bb_info_initialized_p before accessing bb
insns.
gcc/cfgrtl.c