This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][2/2] Sanity check removed loops
- From: Jeff Law <law at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 05 Sep 2014 10:48:51 -0600
- Subject: Re: [PATCH][2/2] Sanity check removed loops
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1409051154450 dot 20733 at zhemvz dot fhfr dot qr>
On 09/05/14 04:00, Richard Biener wrote:
The following patch adds sanity checking for loops removed
via mark_loop_for_removal or fix_loop_structure to check
whether they reappear in the same place.
The simplest case is where the loop header stays the same
and we definitely should avoid all these cases.
The other case is where the old header becomes part of
a newly discovered loop. That happens when you rotate
a loop for example.
The interesting bits of this are the new former_header field
in struct loop which holds onto the old header basic-block
so that even when it gets discarded its memory will not be
reused. For the sanity checking we can then verify if
it is still a basic-block in the current function.
In theory we might be able to "autodetect" some loop
rotation cases as well as "restore" bogusly removed loops.
I'll see what the best solution is here after I (or somebody
else) has some testcases to look at.
Bootstrap and regtest running on x86_64-unknown-linux-gnu.
Richard.
2014-09-05 Richard Biener <rguenther@suse.de>
* cfgloop.c (mark_loop_for_removal): Record former header
when ENABLE_CHECKING.
* cfgloop.h (strut loop): Add former_header member when
ENABLE_CHECKING.
* loop-init.c (fix_loop_structure): Sanity check loops
marked for removal if they re-appeared.
Thanks for taking care of this....
Jeff