This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] pretty-ipa merge 11: ehcleanup pass
> Jan Hubicka wrote:
>
> > PR middle-end/28850
> > * tree-pass.h (pass_cleanup_eh): New.
>
> This pass seems to break SJLJ-based EH (at least on SPU). I'm getting
> crashes (segmentation fault) during libstdc++ build -- if the pass is
> disabled, everything is back to normal.
>
> The problem seems to be related to the sjlj_find_directly_reachable_regions
> routine. Apparently there is some disconnect between the set of regions
> discovered by this routine and the set of regions used by the rest of the
> EH machinery.
>
> One symptom is that the loop in sjlj_find_directly_reachable_regions
> crashes here:
>
> region = VEC_index (eh_region, cfun->eh->region_array, INTVAL (XEXP (note, 0)));
>
> type_thrown = NULL_TREE;
> if (region->type == ERT_THROW)
> {
>
> because of a NULL "region" pointer.
Adding there if (region == NULL) continue; should be safe.
We now can eliminate toplevel catch blocks and replace them by toplevel
region. There are similar checks now in can_throw_internal etc.
>
> Another symptom is that some region is *not* recognized as reachable by
> this routine, and therefore does not get a landing pad -- but later on,
> reachable_handlers considers that region reachable after all, and then
> crashes because the landing pad label is NULL ...
>
> Any suggestions where to look further?
I don't see any bug here offhand, but in theyory since all unreachable
regions now get tree_label NULL, perhaps disabling the whole walk and
relying on test for non-NULL label will do same job.
Tomorrow I will probably be offline whole day but I will look into this
at thursday.
Honza
>
> Bye,
> Ulrich
>
> --
> Dr. Ulrich Weigand
> GNU Toolchain for Linux on System z and Cell BE
> Ulrich.Weigand@de.ibm.com