[commit: ghc] master: Sparc*: Prevent GHC from doing unaligned accesses (19ce8a5)

git at git.haskell.org git at git.haskell.org
Tue Nov 1 19:32:18 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/19ce8a53e8074a7e56fd462e43750386e67edcd4/ghc

>---------------------------------------------------------------

commit 19ce8a53e8074a7e56fd462e43750386e67edcd4
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Wed Nov 2 06:26:22 2016 +1100

    Sparc*: Prevent GHC from doing unaligned accesses
    
    This is specifically for the C backend on Sparc64 (which has
    no native backend) but is also required for Sparc when building
    un-registerised.
    
    Bug reported via Debian (patch included):
    
        https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842780
    
    Test Plan: validate
    
    Reviewers: hvr, Phyx, bgamari, austin, simonmar
    
    Reviewed By: Phyx
    
    Subscribers: jrtc27, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2661
    
    GHC Trac Issues: #12793


>---------------------------------------------------------------

19ce8a53e8074a7e56fd462e43750386e67edcd4
 compiler/cmm/PprC.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
index 331dd67..6380451 100644
--- a/compiler/cmm/PprC.hs
+++ b/compiler/cmm/PprC.hs
@@ -1110,6 +1110,8 @@ cLoad expr rep
           bewareLoadStoreAlignment ArchMipsel   = True
           bewareLoadStoreAlignment (ArchARM {}) = True
           bewareLoadStoreAlignment ArchARM64    = True
+          bewareLoadStoreAlignment ArchSPARC    = True
+          bewareLoadStoreAlignment ArchSPARC64  = True
           -- Pessimistically assume that they will also cause problems
           -- on unknown arches
           bewareLoadStoreAlignment ArchUnknown  = True



More information about the ghc-commits mailing list