This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Remap goto_locus on edges during inlining
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 28 Jun 2018 12:45:58 +0200
- Subject: Re: [patch] Remap goto_locus on edges during inlining
- References: <1959532.xT2u3vGzl1@polaris> <3cdfbd47-00b4-299f-4e5a-afceed78190f@redhat.com> <CAFiYyc3VeM0_nbX12Rn90tntcY8m_hi7=irtWhPuAL+_ugSgPA@mail.gmail.com>
> Related we're also missing to verify_location () on those in
> verify_gimple_in_cfg. Having stale references to GCed BLOCKs
> via locations can be difficult to track down...
>
> So can you add the verification bits as well?
Like this?
* tree-cfg.c (verify_gimple_in_cfg): Call verify_location on the
goto_locus of each outgoing edge of each basic block.
--
Eric Botcazou
Index: tree-cfg.c
===================================================================
--- tree-cfg.c (revision 262207)
+++ tree-cfg.c (working copy)
@@ -5286,6 +5286,8 @@ verify_gimple_in_cfg (struct function *f
FOR_EACH_BB_FN (bb, fn)
{
gimple_stmt_iterator gsi;
+ edge_iterator ei;
+ edge e;
for (gphi_iterator gpi = gsi_start_phis (bb);
!gsi_end_p (gpi);
@@ -5407,6 +5409,10 @@ verify_gimple_in_cfg (struct function *f
debug_gimple_stmt (stmt);
err |= err2;
}
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (e->goto_locus != UNKNOWN_LOCATION)
+ err |= verify_location (&blocks, e->goto_locus);
}
hash_map<gimple *, int> *eh_table = get_eh_throw_stmt_table (cfun);