------- Comment #14 from aoliva at gcc dot gnu dot org 2009-10-06 06:05 ------- The patch that introduces debug temps fixes the problem in #c9. http://gcc.gnu.org/ml/gcc-patches/2009-10/msg00112.html
As for the testcase in #c10, the behavior is correct. If the pseudo holding a value becomes dead at a certain point, we shouldn't reference the dead value in subsequent debug insns because, well, it is dead. Trying to keep it alive would do us no good: it would likely cause codegen differences. Now... Maybe we could make room for finding the value in alternate locations, adding a debug temp insn right before the death of the pseudo, and referencing the debug temp instead of the pseudo itself. This wouldn't help if it's the only location known to hold the value, and that location gets actually clobbered afterwards, say if a register gets reused. We might end up with lots of useless debug stmts. However, if the value survives, or is found at an equivalent location, we might still represent it, but should we? If we found the value to be dead, wouldn't it be more accurate to say so? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41353