[GHC] #7684: cgrun071 segfaults

GHC ghc-devs at haskell.org
Sun Mar 23 07:31:19 UTC 2014


#7684: cgrun071 segfaults
----------------------------------+----------------------------------
        Reporter:  tibbe          |            Owner:
            Type:  bug            |           Status:  merge
        Priority:  normal         |        Milestone:  7.8.1
       Component:  Compiler       |          Version:  7.7
      Resolution:  fixed          |         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):

 Replying to [comment:57 simonmar]:
 > FWIW I think gcc probably should be zero-extending in the caller, not
 the callee, for an 8-bit argument (i.e. gcc 4.2 is correct, 4.9 is wrong).
 This is what we assume in GHC.  I couldn't see anything about this in the
 ABI spec, but there's a gcc bug open:
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942

 According to [http://gcc.gnu.org/ml/gcc/2013-01/msg00447.html the
 discussion with an editor of the System V x86_64 ABI] rwbarton linked to
 above, it's incorrect for the callee to assume that the register has been
 zero extended. Accessing bits outside the specified argument size is
 intentionally undefined behavior (which means that the callee has to zero
 extend).

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


More information about the ghc-tickets mailing list