[Git][ghc/ghc][wip/stefansf/fix-llvm-align] llvmGen: Align objects in the data section

Stefan Schulze Frielinghaus (@stefansf) gitlab at gitlab.haskell.org
Mon Nov 27 11:38:20 UTC 2023



Stefan Schulze Frielinghaus pushed to branch wip/stefansf/fix-llvm-align at Glasgow Haskell Compiler / GHC


Commits:
bed85f7b by Stefan Schulze Frielinghaus at 2023-11-27T12:34:47+01:00
llvmGen: Align objects in the data section

Objects in the data section may be referenced via tagged pointers.
Thus, align those objects to a 4- or 8-byte boundary for 32- or 64-bit
platforms, respectively.  Note, this may need to be reconsidered if
objects with a greater natural alignment requirement are emitted as e.g.
128-bit atomics.

Fixes #24163.

- - - - -


1 changed file:

- compiler/GHC/CmmToLlvm/Data.hs


Changes:

=====================================
compiler/GHC/CmmToLlvm/Data.hs
=====================================
@@ -89,6 +89,7 @@ genLlvmData (sec, CmmStaticsRaw lbl xs) = do
         align          = case sec of
                             Section CString _ -> if (platformArch platform == ArchS390X)
                                                     then Just 2 else Just 1
+                            Section Data _    -> Just $ platformWordSizeInBytes platform
                             _                 -> Nothing
         const          = if sectionProtection sec == ReadOnlySection
                             then Constant else Global



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bed85f7bc358fdca4677a3070b94ea544bb9e7ff

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bed85f7bc358fdca4677a3070b94ea544bb9e7ff
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231127/50234573/attachment-0001.html>


More information about the ghc-commits mailing list