This is the mail archive of the
mailing list for the GCC project.
RE: dom requires PROP_loops
- From: Paulo Matos <pmatos at broadcom dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 13 Mar 2014 16:00:53 +0000
- Subject: RE: dom requires PROP_loops
- Authentication-results: sourceware.org; auth=none
- References: <19EB96622A777C4AB91610E763265F4642D9F1 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <CAFiYyc0=pg8=017-gmiXeXFWvexrt7mhruuVrD5N-kJGP9ez4g at mail dot gmail dot com> <19EB96622A777C4AB91610E763265F4642F387 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <19EB96622A777C4AB91610E763265F4642F4E4 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <CAFiYyc2X4r3GTr4uX_=05JH4v_9AXRciyBm9QzBS6=jfNAEfhw at mail dot gmail dot com>
> -----Original Message-----
> From: Richard Biener [mailto:email@example.com]
> Sent: 13 March 2014 13:24
> To: Paulo Matos
> Cc: firstname.lastname@example.org
> Subject: Re: dom requires PROP_loops
> Probably RTL cfgcleaup needs the same treatment as GIMPLE cfgcleanup
> then - allow removal if loop properties allows it.
In both cfgcleanup.c and tree-cfgcleanup.c I can see code that protects loop latches, but I see no code that allows removal of latch if property allows it.
From what you say I would expect this would already be implemented in tree-cfgcleanup.c, however what actually happens is that since current_loops is non-null (PROP_loops is not destroyed in tree loopdone), tree-cfgcleanup call chain ends up calling cleanup_tree_cfg_bb on the bb loop latch and tree_forwarder_block_p returns false for bb because of the following code thereby not removing the latch:
/* Protect loop latches, headers and preheaders. */
if (bb->loop_father->header == bb)
dest = EDGE_SUCC (bb, 0)->dest;
if (dest->loop_father->header == dest)
Why do we need to protect the latch?