When a register is set outside of a loop and referenced inside, update_life_info can't figure out that the set is dead because the loop appears to still use the register according to the lifeness information which is propagated circularily around the loop. delete_trivially_dead_insns can detect that such sets are dead, and thus remove them. However, it does not update the liveness information. This leads to a checking ICE when doing the next global update.
The gcc 3.2 version of this patch (short version) for this problem looks like this: 2004-05-17 J"orn Rennecke <[EMAIL PROTECTED]> * cse.c (basic-block.h): #include. (trivially_dead_nonlocal_regs): New variable. (note_dead_set): New function. (delete_trivially_dead_insns): If life info is available, update it. The patch in its current form is conceptually dependent on the patch for gcc/18992 being applied first and also has some bits to support highpart liveness information optimizations. It is about 100 lines of unidiff. If someone is prepared to review the patch, I can extract an independent patch against the then-current mainline. -- Summary: delete_trivially_dead_insns fails to update the liveness information Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: ice-checking Severity: normal Priority: P2 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: amylaar at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org BugsThisDependsOn: 18992 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18995