Index: llvm/trunk/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp =================================================================== --- llvm/trunk/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp +++ llvm/trunk/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp @@ -586,7 +586,7 @@ StDisp2 += OverlapDelta; Size2 -= OverlapDelta; } - Size1 = std::abs(std::abs(LdDisp2) - std::abs(LdDisp1)); + Size1 = LdDisp2 - LdDisp1; // Build a copy for the point until the current blocking store's // displacement. Index: llvm/trunk/test/CodeGen/X86/pr39926.ll =================================================================== --- llvm/trunk/test/CodeGen/X86/pr39926.ll +++ llvm/trunk/test/CodeGen/X86/pr39926.ll @@ -8,9 +8,9 @@ ; CHECK-NEXT: movb $0, 7(%rdi) ; CHECK-NEXT: movw $0, 5(%rdi) ; CHECK-NEXT: movl $0, 1(%rdi) -; CHECK-NEXT: movzwl -4(%rdi), %eax -; CHECK-NEXT: movw %ax, -{{[0-9]+}}(%rsp) -; CHECK-NEXT: movb -2(%rdi), %al +; CHECK-NEXT: movl -4(%rdi), %eax +; CHECK-NEXT: movl %eax, -{{[0-9]+}}(%rsp) +; CHECK-NEXT: movb (%rdi), %al ; CHECK-NEXT: movb %al, -{{[0-9]+}}(%rsp) ; CHECK-NEXT: movl 1(%rdi), %eax ; CHECK-NEXT: movl %eax, -{{[0-9]+}}(%rsp)