From 0dc7b36c3c261b3eccf8460581fcd3d71f6e6ff6 Mon Sep 17 00:00:00 2001 From: Simon Brenner Date: Wed, 27 Jan 2016 11:05:35 +0100 Subject: Restore original alignment for info tables This was broken in 4a32bf925b8aba7885d9c745769fe84a10979a53, meaning that info tables and subsequent code are no longer guaranteed to have the recommended alignment. Split up the section header and section alignment printers, and print an appropriate alignment directive before each info table. Fixes Trac #11486 Reviewers: austin, bgamari, rwbarton Reviewed By: bgamari, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1847 GHC Trac Issues: #11486 --- compiler/nativeGen/SPARC/Ppr.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/nativeGen/SPARC') diff --git a/compiler/nativeGen/SPARC/Ppr.hs b/compiler/nativeGen/SPARC/Ppr.hs index 8c7871e059..eb41f2390f 100644 --- a/compiler/nativeGen/SPARC/Ppr.hs +++ b/compiler/nativeGen/SPARC/Ppr.hs @@ -96,7 +96,7 @@ pprBasicBlock info_env (BasicBlock blockid instrs) maybe_infotable = case mapLookup blockid info_env of Nothing -> empty Just (Statics info_lbl info) -> - pprSectionAlign (Section Text info_lbl) $$ + pprAlignForSection Text $$ vcat (map pprData info) $$ pprLabel info_lbl @@ -326,6 +326,11 @@ pprSectionAlign :: Section -> SDoc pprSectionAlign sec@(Section seg _) = sdocWithPlatform $ \platform -> pprSectionHeader platform sec $$ + pprAlignForSection seg + +-- | Print appropriate alignment for the given section type. +pprAlignForSection :: SectionType -> SDoc +pprAlignForSection seg = ptext (case seg of Text -> sLit ".align 4" Data -> sLit ".align 8" -- cgit v1.2.1