On Mon, 2006-01-02 at 19:31 +0100, Laurent GUERBY wrote: > Hi Rainer, this is PR24994: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24994 > > And is under investigation: > > http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01756.html > So, here's what appears to be happening.
1. A statement is recorded into the EH throw statement hash table. 2. SRA replaces the statement in the IL, but does not remove the statement from the EH throw statement table. This is our bug. 3. remove_cfg_annotations removes annotations from all the statements in the IL, but note that it does not walk the EH throw table (a reasonable thing since statements in the EH table ought to appear in the IL). 4. Eventually the RTL optimizers run and remove the block referenced by the bogus statement in the EH hash table. 5. Even later GC runs, walks the EH throw statement table, the bogus statement within the table, then the bogus statement's annotation, then the block in the annotation, which was expunged and unlinked leading to dereferencing a null pointer. It'll take until tomorrow or so before I can get all the bootstrapping and regression testing done, but I'm pretty sure all we need to do is add remove_stmt_from_eh_region (orig_stmt); into the appropriate location within bsi_replace. jeff