Sparc*: Prevent GHC from doing unaligned accesses
authorErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 1 Nov 2016 19:26:22 +0000 (06:26 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 1 Nov 2016 19:26:22 +0000 (06:26 +1100)
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

compiler/cmm/PprC.hs

index 331dd67..6380451 100644 (file)
@@ -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