Hi! On the testcase from this PR on AVR (from libgcc, thus not including it into testsuite/) we ICE, because dead_debug_insert_temp is called several times on the same insn, for multi-register hard register for each regno in it (except the first which doesn't seem to be dead). In the first call dead_debug_insert_temp changes *DF_REF_REAL_LOC to DEBUG_EXPR, and in the next call for the next consecutive hard register we set reg variable to *DF_REF_REAL_LOC and rely on it to be a REG, when it is a DEBUG_EXPR already instead. No change is needed in that case.
Bootstrapped/regtested on x86_64-linux and i686-linux (where this never kicks in though), tested on the testcase in cross to avr. Ok for trunk? 2012-08-20 Jakub Jelinek <ja...@redhat.com> PR debug/53923 * valtrack.c (dead_debug_insert_temp): Drop non-reg uses from the chain. --- gcc/valtrack.c.jj 2012-08-10 12:57:21.000000000 +0200 +++ gcc/valtrack.c 2012-08-20 14:59:07.609586159 +0200 @@ -336,6 +336,14 @@ dead_debug_insert_temp (struct dead_debu { if (DF_REF_REGNO (cur->use) == uregno) { + /* If this loc has been changed e.g. to debug_expr already + as part of a multi-register use, just drop it. */ + if (!REG_P (*DF_REF_REAL_LOC (cur->use))) + { + *tailp = cur->next; + XDELETE (cur); + continue; + } *usesp = cur; usesp = &cur->next; *tailp = cur->next; Jakub