This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix for infinite loop in cse.c
- To: gcc-patches at gcc dot gnu dot org
- Subject: Fix for infinite loop in cse.c
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 01 Aug 1999 23:54:26 -0600
- Reply-To: law at cygnus dot com
This patch fixes an infinite loop in cse that was reported in June.
Basicaly delete_insn returns without updating the insn chain if it is
presented with an insn that has INSN_DELETED_P set. Since no side effects
occurred in that case, the loop in cse just spun trying to delete the
same insn over and over.
The fix (which wasn't obvious when we first looked at the problem) is to
not ignore the return value of delete_insn -- it will return the first
insn that it did not delete (or pretend to delete), which is precisely what
we wanted.
There was speculation that delete_barrier_successors had the same bug, but it
already was using the return value from delete_insn, which is further evidence
that this is the right fix.