> Combiner has code to adjust this too (propagate_for_debug), but only > updates debug insns between i2 and i3 (resp. i3 and undobuf.other_insn). > The problem on the testcase is that this is a retry, so first > try_combine with a later i3 calls propagate_for_debug and changes debug > insns before that later i3, then returns an earlier insn that should be > retried and we stop adjusting debug insns at that earlier i3. > Unfortunately as later debug insns have been already updated earlier, they > need to be adjusted too. > > The following patch fixes that by always stopping on the latest i3 that has > been successfully combined into in the current bb, bootstrapped/regtested > on x86_64-linux and i686-linux, ok for trunk/4.6?
This seems to be a rare problem though so I'm not sure we should directly go for an "always" approach. IIUC this can happen only when try_combine returns a NEXT to combine_instructions which is before INSN in the stream, right? Can't we precisely detect this case under the "retry:" label and pass an additional argument to try_combine? Do we really need to adjust all the calls to propagate_for_debug and not just the ones made for UNDO_MODE when the register is I2DEST? -- Eric Botcazou