------- Comment #9 from jakub at gcc dot gnu dot org 2009-09-16 17:17 ------- Another interesting testcase: int foo (int i) { asm volatile ("" : "+r" (i)); int i1 = 2 * i; int i2 = 2 * i; int i3 = 3 * i; asm volatile ("" : "+r" (i) : : "memory"); return i; } Here things go wrong during regmove I'd say. Before regmove, the first asm sets (reg:SI 60 [i]), which is also used in several DEBUG_INSNS (for i, i1, i2, i3) in between the 2 asms, then the second asm uses pseudo 60 and sets 61. regmove changes it to use pseudo 61 in all places (starting even before the first asm), but none of the debug_insn arguments are changed, so they all refer to a dead pseudo 60 and during RA they become clobber 0.
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41353