> This patch tries to fix this problem by resetting the source location > when moving instructions to another BB. This can greatly improve the > debuggability of optimized code. For the attached unittest. Without > the patch, the debugger will always jump into line 14 even when the > branch at line 13 is not taken. With the patch, the problem is fixed.
But this breaks coverage info! You cannot change the source location of instructions randomly like that; the rule should be that, once a location is set, it cannot be changed. At most it can be cleared. > gcc/ChangeLog: > 2012-10-31 Dehao Chen <de...@google.com> > > * emit-rtl.c (reorder_insns): Reset the source location for > instructions moved out of its original residing basic block. No, that isn't acceptable. -- Eric Botcazou