This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pretty-ipa merge 14: EH region label sharing code


On Fri, Apr 24, 2009 at 8:34 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> this is last EH redirection preparation bit. ?It makes code happy about case
> where two regions share same label. This happens by EH redirection but also by
> cfgcleanup and such.
>
> While this is generally easy to maintain linked list of regions sharing
> label, tricky part is eh cleanup where we now can have empty cleanup reached by
> multiple EH handlers and none of them must be same as the one resuming it.
> This is hanled by removing all the reaching EH handlers and replacing them by
> outer handler of the resuming one.
>
> It is also possible that other control flow reaches the empty handler and in
> this case BB is no longer removed and resuming EH is kept in place. This
> happens sometimes when EH region proves to be empty over some paths only
> after edge splitting.
>
> I also bundled in remove_eh_handler_and_replace change that allows removing
> try region without associated catch and also to update prev_try pointers. ?This
> is really needed for EH merging, but it is bit difficult to split it out of
> the patch.
>
> Bootstrapped/regtested x86_64-linux, OK?
> ? ? ? ?* tree-eh.c (tree_remove_unreachable_handlers): Handle shared labels.
> ? ? ? ?(tree_empty_eh_handler_p): Allow non-EH predecestors; allow region
> ? ? ? ?to be reached by different label than left.
> ? ? ? ?(update_eh_edges): Update comment; remove edge_to_remove if possible
> ? ? ? ?and return true if suceeded.
> ? ? ? ?(cleanup_empty_eh): Accept sharing map; handle shared regions.
> ? ? ? ?(cleanup_eh): Compute sharing map.
> ? ? ? ?* except.c (remove_eh_handler_and_replace): Add argument if we should
> ? ? ? ?update regions.
> ? ? ? ?(remove_unreachable_regions): Update for label sharing.
> ? ? ? ?(label_to_region_map): Likewise.
> ? ? ? ?(get_next_region_sharing_label): New function.
> ? ? ? ?(remove_eh_handler_and_replace): Add update_catch_try parameter; update
> ? ? ? ?prev_try pointers.
> ? ? ? ?(remove_eh_handler): Update.
> ? ? ? ?(remove_eh_region_and_replace_by_outer_of): New function.
> ? ? ? ?* except.h (struct eh_region): Add next_region_sharing_label.
> ? ? ? ?(remove_eh_region_and_replace_by_outer_of,
> ? ? ? ?get_next_region_sharing_label): Declare.
> ? ? ? ?* tree-cfgcleanup.c (tree_forwarder_block_p): Simplify.

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39898

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]