This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix for infinite loop in cse.c



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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]