https://llvm.org/bugs/show_bug.cgi?id=26665
Bug ID: 26665 Summary: Not extending i8 return values (r260133) broke Chromium on Darwin <= 10.9 Product: libraries Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Backend: X86 Assignee: unassignedb...@nondot.org Reporter: h...@chromium.org CC: llvm-bugs@lists.llvm.org, nicolaswe...@gmx.de, rjmcc...@apple.com Classification: Unclassified r260133 changed LLVM to no longer extend i8/i16 return values to 32-bits, as that is not required by the ABI and neither GCC or MSVC does it. However, we found code in the wild relying on Clang's old behaviour, specifically in the AppKit framework on Mac OS X <= 10.9 (we tested 10.8, 10.9, 10.10 and 10.14): After LLVM r260133, the following Objective-C method in Chromium would no longer extend its BOOL (signed char) return value: browser_tests`-[NativeWidgetMacNSWindow canBecomeMainWindow]: [...] 0x1017e3c68: movq %rbx, %rdi 0x1017e3c6b: callq 0x1018284c0 ; views::NativeWidgetMac::GetBridgeForNativeWindow(NSWindow*) 0x1017e3c70: cmpq $0x0, 0x98(%rax) 0x1017e3c78: sete %al 0x1017e3c7b: jmp 0x1017e3c83 ; -[NativeWidgetMacNSWindow canBecomeMainWindow] + 83 [...] 0x1017e3c83: addq $0x8, %rsp 0x1017e3c87: popq %rbx 0x1017e3c88: popq %rbp 0x1017e3c89: ret However, that function would get called by AppKit like this: AppKit`-[NSApplication makeWindowsPerform:inOrder:]: [...] 0x7fff8b5e770d: movq %rbx, %rdi 0x7fff8b5e7710: movq -0x187e90a7(%rip), %rsi ; "performSelector:" 0x7fff8b5e7717: movq -0x40(%rbp), %rdx 0x7fff8b5e771b: callq *-0x18931e99(%rip) ; (void *)0x00007fff81b6b240: objc_msgSend -> 0x7fff8b5e7721: testq %rax, %rax Note that the caller is expecting the return value to have been extended to the full width of %rax. I'm not sure what the AppKit code is doing or what "performSelector" is, but presumably there's some mismatch in the expected return type. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs