[llvm-bugs] The fixup referring to nop or nop-like instruction

Hyungjoon Koo via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 13 07:02:12 PDT 2017


This is duplicate sent to llvm-dev, but llvm-bugs looks a better place to ask.

Compiled Xalan (one of SPEC2006 programs) with -O2 level in llvm 3.9.0,
I have discovered the fixup of the jmp instruction at 0x4143FF is pointing
to nop instruction (at 0x414175) instead of the next instruction at 0x414180.

.text:0000000000414175 nop word ptr [rax+rax+00000000h]
.text:0000000000414180 mov rax, [r14]
.text:0000000000414183 mov rbx, [rax+0F8h]
...
.text:00000000004143F7 mov     rdi, rbx
.text:00000000004143FA call    ___cxa_throw
.text:00000000004143FF jmp     loc_414175
...

The following is another example that the unconditional branch (0x460025)
points to *nop-like* instruction
(xchg ax, ax @0x46003e) instead of the next instruction (0x460040).
...
.text:0000000000460025 jmp     short loc_46003E
.text:0000000000460027 xor     ebp, ebp
.text:0000000000460029 jmp     loc_4602F9
.text:000000000046002E align 10h
.text:0000000000460030 lea     edx, [rax+1]
.text:0000000000460033 mov     [r12+4], edx
.text:0000000000460038 mov     eax, eax
.text:000000000046003A mov     [rcx+rax*2], bp
.text:000000000046003E xchg    ax, ax
.text:0000000000460040 mov     rdi, [rbx+50h]  ; this
...

Xalan is the only case that has this particular issue of all SPEC - 13
fixups in total point to 3 locations that contain either nop or nop-like
instructions. I understand there is no problem to execute the binary but why
LLVM emits the binary that has fixups referring to NOP (MC alignment fragment),
not a legitimate code fragment (or logical basic block)? Is this expected?

Thanks!


Best Regards,
Hyungjoon Koo (Kevin)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170713/5159dab0/attachment.html>


More information about the llvm-bugs mailing list