drreg error restoring tool value before app update for app instr that reads + writes
I hit a drreg bug where a tool has reserved a reg across an app instr that both reads and writes the reg: drreg was incorrectly restoring the tool value before writing out the new app value.
TAG 0x00007fd73015dc91
rcx is dead so reservation here inserts nothing.
+0 m4 @0x0000000051bb9070 65 48 8b 0c 25 b0 00 mov %gs:0x000000b0[8byte] -> %rcx
00 00
+9 m4 @0x0000000051bb8f38 48 be 91 0c 01 00 0c mov $0x2000e00c00010c91 -> %rsi
e0 00 20
+19 m4 @0x0000000051bb8ff8 48 89 31 mov %rsi -> (%rcx)[8byte]
+22 m4 @0x0000000051bb9d48 <label>
+22 m4 @0x0000000051bb9f70 48 8d 49 08 lea 0x08(%rcx) -> %rcx
+26 m4 @0x0000000051bb97d8 65 48 89 0c 25 b0 00 mov %rcx -> %gs:0x000000b0[8byte]
00 00
+35 L3 48 89 d6 mov %rdx -> %rsi
drreg preserving tool value:
+38 m4 @0x0000000051bb5f58 65 48 89 0c 25 a0 00 mov %rcx -> %gs:0x000000a0[8byte]
00 00
+47 L3 48 63 cb movsxd %ebx -> %rcx
drreg updates app spill slot:
+50 m4 @0x0000000051bb9ef8 65 48 89 0c 25 98 00 mov %rcx -> %gs:0x00000098[8byte]
00 00
drreg restores tool value:
+59 m4 @0x0000000051bba7f8 65 48 8b 0c 25 a0 00 mov %gs:0x000000a0[8byte] -> %rcx
00 00
+68 L3 4c 29 fe sub %r15 %rsi -> %rsi
drreg preserving tool value:
+71 m4 @0x0000000051bb6720 65 48 89 0c 25 a0 00 mov %rcx -> %gs:0x000000a0[8byte]
00 00
drreg restores app value:
+80 m4 @0x0000000051bb9310 65 48 8b 0c 25 98 00 mov %gs:0x00000098[8byte] -> %rcx
00 00
+89 L3 48 c1 e1 04 shl $0x0000000000000004 %rcx -> %rcx
out of order -- drreg restoring tool value should be after next line:
+93 m4 @0x0000000051bb9238 65 48 8b 0c 25 a0 00 mov %gs:0x000000a0[8byte] -> %rcx
00 00
drreg updating app spill slot:
+102 m4 @0x0000000051bb90e8 65 48 89 0c 25 98 00 mov %rcx -> %gs:0x00000098[8byte]
00 00
+111 L3 48 85 f6 test %rsi %rsi