
#9125: int-to-float conversion broken on ARM -------------------------------------+------------------------------------- Reporter: Ansible | Owner: Type: bug | Status: infoneeded Priority: highest | Milestone: 7.8.4 Component: Compiler | Version: 7.8.3 (CodeGen) | Keywords: Resolution: | Architecture: arm Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Incorrect | Related Tickets: result at runtime | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): Actually I prefer this one, since I can read x86 assembly better than ARM assembly :) The TBAA patch had the expected effect on the .ll file. But LLVM 3.0 still decided to carefully save the input value across the function call so that it can erroneously return it as the result (esi). {{{ 00000748 83ec1c sub esp, 0x1c 0000074b 8d45fc lea eax, [ebp-4] 0000074e 3bab1c030000 cmp ebp, [ebx+0x31c] 00000754 7235 jc 0x78b 00000756 f30f104500 movss xmm0, [ebp] 0000075b f30f11442418 movss [esp+0x18], xmm0 00000761 f30f11442408 movss [esp+0x8], xmm0 00000767 89442404 mov [esp+0x4], eax 0000076b 892c24 mov [esp], ebp 0000076e e815faffff call __decodeFloat_Int 00000773 8b45fc mov eax, [ebp-4] 00000776 894500 mov [ebp], eax 00000779 8b4504 mov eax, [ebp+0x4] 0000077c f30f10442418 movss xmm0, [esp+0x18] 00000782 660f7ec6 movd esi, xmm0 00000786 83c41c add esp, 0x1c 00000789 ffe0 jmp eax }}} I think this is just a bug in LLVM 3.0, particularly as you say LLVM 3.4 has the expected behavior. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9125#comment:31 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler