[Bug debug/54551] DF resets some DEBUG_INSNs unnecessarily

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 12 05:56:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54551

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-09-12 05:54:29 UTC ---
If there is a death point of the pseudo that dominates bbs with uses in some
debug insns, then I think best is to insert the debug temporary immediately
before the death point.  If the death point of the pseudo doesn't dominate the
bb with debug uses, or if there are multiple death point in different branches,
but if the setter of the pseudo dominates the bb with debug uses or if there is
some bb where the pseudo is live, isn't changed afterwards and that spot
dominates the debug uses, then the best spot to insert the debug temporary is
probably before the conditional jump/whatever other control changing insn at
the end of that bb.  E.g. for:
+---+      |
|set|     / \
+---+  +---++---+
  |    |set||set|
 / \   +---++---+
 | |      | |
 \ /      \ /
 (1)       |
+-----+   (2)
|death|   / \
+-----+  |   \
  |   +-----+ \
 / \  |death| +-----+
 |  | +-----+ |death|
 | / \      | +-----+
 | | |      \ /
 | \ /       |
 |  |        +------+
 | +------+  |dbguse|
 | |dbguse|  +------+
 | +------+

I think we want to insert the debug temp at (1) resp. (2).  If there is no such
spot, I think we have to give up, trying to build (if_then_else (condition)
D#1234 D#2345) would bloat the debug info too much. Still handling even the
dominating cases would be better than what we have right now.

Perhaps we could handle single setters first if DF has computed that already.
Perhaps this handling could be keyed off some new DF flag which would only be
set in the first cse pass.



More information about the Gcc-bugs mailing list