[GHC] #7684: cgrun071 segfaults

GHC ghc-devs at haskell.org
Sat Mar 22 15:57:31 UTC 2014


#7684: cgrun071 segfaults
----------------------------------+----------------------------------
        Reporter:  tibbe          |            Owner:
            Type:  bug            |           Status:  infoneeded
        Priority:  normal         |        Milestone:  7.8.1
       Component:  Compiler       |          Version:  7.7
      Resolution:                 |         Keywords:
Operating System:  MacOS X        |     Architecture:  x86_64 (amd64)
 Type of failure:  Runtime crash  |       Difficulty:  Unknown
       Test Case:  cgrun071       |       Blocked By:
        Blocking:                 |  Related Tickets:
----------------------------------+----------------------------------

Comment (by tibbe):

 I think I've figured it out. I've installed the CLI tools that came with
 XCode 4.6. Here's the gcc that's included:

 {{{
 $ gcc --version
 i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build
 5658) (LLVM build 2336.11.00)
 }}}

 So this is a LLVM-based GCC (i.e. clang). This GCC indeed produces
 incorrect code for `popcnt.c`:

 {{{
 #!asm
 _hs_popcnt8:
 Leh_func_begin1:
         pushq   %rbp
 Ltmp0:
         movq    %rsp, %rbp
 Ltmp1:
         leaq    _popcount_tab(%rip), %rax
         movzbl  (%rdi,%rax), %eax
         popq    %rbp
         ret
 }}}

 Note how the argument is not zero extended when it's used to compute and
 address in `_popcount_tab`.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7684#comment:49>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list