[PATCH] Fix inconsistent CFG out of DOM1
Richard Guenther
richard.guenther@gmail.com
Sun May 18 09:59:00 GMT 2008
On Sun, May 18, 2008 at 10:57 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> The attached testcase triggers a CFG verification failure after DOM1:
>
> eric@linux:~/build/gcc/native32> gcc -S -gnata -O2 -fno-inline p.adb
> p.adb: In function 'P.Interface_Ancestor_Tags':
> p.adb:14: error: BB 31 can not throw but has EH edges
> +===========================GNAT BUG DETECTED==============================+
> | 4.4.0 20080515 (experimental) [trunk revision 135325] (i586-suse-linux-gnu)
> GCC error:|
> | verify_flow_info failed |
> | Error detected around p.adb:14
>
> BB31 is a forwarder block made by thread_through_loop_header ouf of BB15 and
> we have in the DOM1 log:
>
> Optimizing block #15
>
> Optimizing statement p__interface_ancestor_tags__B_2__TTtableSP1___U.7_47 =
> iface_table_6->nb_ifaces;
> Replaced redundant expr 'iface_table_6->nb_ifaces' with
> 'p__interface_ancestor_tags__B_2__TTtableSP1___U.7_42'
> Flagged to clear EH edges.
>
>
> The problem is that, while BB31 inherits everything from BB15, it doesn't
> inherit the "flagged to clear EH edges" property, hence the failure.
>
> The proposed fix is to include the newly created blocks in the set of blocks
> needing EH cleanup after DOM. Tested on i586-suse-linux, OK for mainline?
Hm, this exposes that we always allocate new blocks after the old ones, which
in theory should be an implementation detail... but I guess we do so elsewhere.
So if you cannot imagine a more elegant solution here the patch is ok.
Thanks,
Richard.
>
> 2008-05-18 Eric Botcazou <ebotcazou@adacore.com>
>
> * tree-ssa-dom.c (tree_ssa_dominator_optimize): If some blocks need
> EH cleanup at the end of the pass, also include the blocks created by
> jump threading in this set.
>
>
> 2008-05-18 Eric Botcazou <ebotcazou@adacore.com>
>
> * gnat.dg/loop_optimization2.ad[sb]: New test.
>
>
> --
> Eric Botcazou
>
More information about the Gcc-patches
mailing list