On Mon, Jun 23, 2014 at 7:32 AM, Chung-Lin Tang <clt...@codesourcery.com> wrote:
> Hi Richard,
>
> In this change:
> https://gcc.gnu.org/ml/gcc-patches/2014-06/msg01278.html
>
> where substitute_and_fold() was changed to use a dom walker, the calls
> to purge dead EH edges during the walk can alter the dom-tree, and have
> chaotic results; the testcase in PR 61554 has some blocks traversed
> twice during the walk, causing the segfault during CCP.
>
> The patch records the to-be-purged-for-dead-EH blocks in a similar
> manner like stmts_to_remove, and processes it after the walk. (another
> possible method would be using a bitmap to record the BBs + calling
> gimple_purge_all_dead_eh_edges...)

Oops.

> Bootstrapped and tested on x86_64-linux, is this okay for trunk?

Can you please use a bitmap and use gimple_purge_all_dead_eh_edges
like tree-ssa-pre.c does?

Also please add the reduced testcase from the PR to the g++.dg/torture

Ok with that changes.

Thanks,
Richard.

> Thanks,
> Chung-Lin
>
> 2014-06-23  Chung-Lin Tang  <clt...@codesourcery.com>
>
>         PR tree-optimization/61554
>         * tree-ssa-propagate.c (substitute_and_fold_dom_walker):
>         Add 'vec<basic_block> bbs_to_purge_dead_eh_edges' member,
>         properly update constructor/destructor.
>         (substitute_and_fold_dom_walker::before_dom_children):
>         Remove call to gimple_purge_dead_eh_edges, add bb to
>         bbs_to_purge_dead_eh_edges instead.
>         (substitute_and_fold): Call gimple_purge_dead_eh_edges for
>         bbs recorded in bbs_to_purge_dead_eh_edges.

Reply via email to