Re: #16258: PowerPC Big-Endian: ArithInt16, ArithInt8, ArithWord16, and ArithWord8 fail
"GHC" <[email protected]> Mon, 04 Mar 2019 18:51:02 -0000
| Newsgroups | gmane.comp.lang.haskell.glasgow.bugs |
|---|---|
| Message-ID | <[email protected]> |
#16258: PowerPC Big-Endian: ArithInt16, ArithInt8, ArithWord16, and ArithWord8 fail
-------------------------------------+-------------------------------------
Reporter: trommler | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.10.1
Component: Compiler | Version: 8.7
Resolution: | Keywords: Big-endian
Operating System: Unknown/Multiple | Architecture: powerpc64
Type of failure: Incorrect result | Test Case:
at runtime | primops/should_run/ArithInt16,
| primops/should_run/ArithWord16,
| primops/should_run/ArithWord8,
| primops/should_run/ArithInt8
Blocked By: | Blocking:
Related Tickets: #16222 | Differential Rev(s):
Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/286
-------------------------------------+-------------------------------------
Comment (by Marge Bot <ben+marge-bot@…>):
In [changeset:"af7b0fdb64ad1c57f5829e8bd89e8e0fa96b11d2/ghc"
af7b0fdb/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="af7b0fdb64ad1c57f5829e8bd89e8e0fa96b11d2"
Cmm: Promote stack arguments to word size
Smaller than word size integers must be promoted to word size
when passed on the stack. While on little endian systems we can
get away with writing a small integer to a word size stack slot
and read it as a word ignoring the upper bits, on big endian
systems a small integer write ends up in the most significant
bits and a word size read that ignores the upper bits delivers
a random value.
On little endian systems a smaller than word size write to
the stack might be more efficient but that decision is
system specific and should be done as an optimization in the
respective backends.
Fixes #16258
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16258#comment:7>