View Revisions: Issue #38980

Summary 0038980: [Patch] [Debug] New label debugging feature
Revision 2021-06-10 01:41 by J. Gareth Moreton
Additional Information I first developed this for aarch64 when I noticed that many label reference counts were higher than they should be (most notably when the only jump was removed, but the destination label was still live), but testing on x86_64-win64 also revealed some labels whose reference counts were too high. For example, in system.s when compiled under -O4:

...
    testb $1,%dl
    je .Lj60
    movb (%rcx,%rdx,1),%al
    decq %r8
    movb %al,(%rdx)
    addq $1,%rdx
# References = 3
.Lj60:
    testb $2,%dl
...

Other than "je .Lj60", there is no other reference to .Lj60, not even in the metadata, yet its reference count is revealed to be 3. In the same subroutine, label .Lj59 is revealed to have a reference count of 6, but there are only 3 actual references (two conditional jumps and one unconditional jump).
Revision 2021-06-10 01:39 by J. Gareth Moreton
Additional Information I first developed this for aarch64 when I noticed that many label reference counts were higher than they should be (most notably when the only jump was removed, but the destination label was still live), but testing on x86_64-win64 also revealed some labels whose reference counts were too high. For example, in system.s when compiled under -O4:

...
    testb $1,%dl
    je .Lj60
    movb (%rcx,%rdx,1),%al
    decq %r8
    movb %al,(%rdx)
    addq $1,%rdx
# References = 3
.Lj60:
    testb $2,%dl
...

There is no other reference to .Lj60, not even in the metadata, yet its reference count is revealed to be 3. In the same subroutine, label .Lj59 is revealed to have a reference count of 6, but there are only 3 actual references (two conditional jumps and one unconditional jump).