http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54128
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aoliva at gcc dot gnu.org, | |jakub at gcc dot gnu.org, | |vmakarov at gcc dot gnu.org --- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-19 10:46:02 UTC --- The first ira.c hunk doesn't make much sense to me, DF_INSN_UID_DEFS should be NULL on any DEBUG_INSN. The second might be acceptable, though I'd say the problem might be elsewhere, in particular calls that return values in multiple registers, but only a subset of those registers is actually used in the code. To some extent the issue can be seen also on i?86, -m32 -O2 -g: long long bar (void); int foo (void) { long long a = bar (); long long b = a; return b + 1; } The call has REG_UNUSED (reg:SI 1 dx) note, so in theory debug insns after the call shouldn't be using it, but they do. And valtrack is a little bit lost on it, it feels it is not ok to do it, but when trying to fix it up it does the same thing (again and again). So we end up with a series of debug insns like: (debug_insn 33 5 24 2 (var_location:SI D#4 (reg:SI 1 dx [+4 ])) -1 (nil)) (debug_insn 24 33 23 2 (var_location:SI D#3 (debug_expr:SI D#4)) -1 (nil)) (debug_insn 23 24 22 2 (var_location:SI D#2 (debug_expr:SI D#3)) -1 (nil)) (debug_insn 22 23 7 2 (var_location:SI D#1 (debug_expr:SI D#2)) -1 (nil)) (debug_insn 7 22 8 2 (var_location:DI a (concatn/v:DI [ (reg:SI 0 ax [orig:65 b ] [65]) (debug_expr:SI D#1) ])) mmm.c:5 -1 (nil)) Wonder if we shouldn't make it explicitly valid that REG_UNUSED registers from a CALL can be referenced in the following debug_insn, provided there are no intervening real insns in between, and teach valtrack.c not to add the extra debug temporaries on each invocation for those. Then the ira.c change would be certainly a must (I think it is desirable anyway), I'd hope there aren't too big -fcompare-debug risks otherwise, because it is only extending the lifetime of the hard register to debug insns immediately following the call and thus not extending it over any other real insns.