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: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 5 Sep 2014 11:01:58 -0700
- 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 Fri, Sep 5, 2014 at 3:00 AM, Richard Biener <rguenther@suse.de> 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.
>
I think it caused:
FAIL: g++.dg/torture/pr57140.C -O3 -fomit-frame-pointer (internal
compiler error)
FAIL: g++.dg/torture/pr57140.C -O3 -fomit-frame-pointer (test for
excess errors)
FAIL: g++.dg/torture/pr57140.C -O3 -fomit-frame-pointer
-funroll-loops (internal compiler error)
FAIL: g++.dg/torture/pr57140.C -O3 -fomit-frame-pointer
-funroll-loops (test for excess errors)
FAIL: g++.dg/torture/pr57140.C -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions (internal compiler error)
FAIL: g++.dg/torture/pr57140.C -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions (test for excess errors)
FAIL: g++.dg/torture/pr57140.C -O3 -g (internal compiler error)
FAIL: g++.dg/torture/pr57140.C -O3 -g (test for excess errors)
on x86.
--
H.J.