[PATCH] PR42859

Richard Henderson rth@redhat.com
Wed Mar 10 16:38:00 GMT 2010


On 03/10/2010 12:40 AM, Andrey Belevantsev wrote:
>     * tree-eh.c: Include pointer-set.h.
>     (lower_eh_dispatch): Filter out duplicate case labels and
>     remove the unneeded edge when the label is unused.  Return
>     true when some edges are removed.
>     (execute_lower_eh_dispatch): When any lowering resulted in
>     removing an edge, also delete unreachable blocks.

This isn't really sufficient.  You also ought to be removing the
catch handler that you're deleting.  E.g. with your test case:

void ptw32_terminate() ()
Eh tree:
   5 cleanup
   1 try land:{2,<L5>} catch:{int}
     4 cleanup
     3 cleanup
     2 try land:{1,<L2>} catch:{int},{int}

in EH region 2, you ought to have removed the second handler
so that it looks more like the try block in EH region 1.

Frankly, i think this ought to be done in a pass of its own.
I can't decide if it would be easier to do right after
pass_lower_eh (when you wouldn't even have to mess with the
cfg, which hasn't been created yet).  Otherwise, do it right
before pass_lower_eh_dispatch.

While I suppose this isn't P1 material, it should be measurable
as a size regression in eh info vs 4.4.


r~



More information about the Gcc-patches mailing list