Richard,

The following patch fixes a CFG consistency problem.

When early IPA optimizations (e.g., early SRA) create a version of a function 
that no longer throws, versioning machinery deletes EH landings pads in 
_callers_ of the function [*].  However, the EH cfg edges are not updated in 
the callers, which eventually leads to an ICE in verify_eh_edges.

I've tried several ways to fix this, including trying to make early 
optimizations not delete callers' landing pads.  You are the original author of 
the gimple EH code, and I wonder if you know the rationale behind removing EH 
landing pads from callers or a function being optimized.

The failure triggers on several libstdc++ testcases, but requires an unrelated 
patch of mine (soon to be posted).

In any case, attached is what appears to be the best way to fix this up.

Bootstrapped and regrested on x86_64-linux-gnu.  OK for trunk?

Thank you,

[*] this is done in cgraphunit.c: update_call_expr() and 
ipa_modify_call_arguments() via maybe_clean[_and_replace]_eh_stmt().

--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics


Attachment: fsf-gcc-fixup_eh.ChangeLog
Description: Binary data

Attachment: fsf-gcc-fixup_eh.patch
Description: Binary data

Reply via email to