[Git][ghc/ghc][wip/romes/12935] Fix ordering of CLabels for IdLabels

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Fri May 24 21:03:12 UTC 2024



Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC


Commits:
dd74409a by Rodrigo Mesquita at 2024-05-24T21:55:34+01:00
Fix ordering of CLabels for IdLabels

- - - - -


1 changed file:

- compiler/GHC/Cmm/CLabel.hs


Changes:

=====================================
compiler/GHC/Cmm/CLabel.hs
=====================================
@@ -349,7 +349,8 @@ newtype NeedExternDecl
 -- code-generation. See Note [Unique Determinism and code generation]
 instance Ord CLabel where
   compare (IdLabel a1 b1 c1) (IdLabel a2 b2 c2) =
-    compare a1 a2 S.<>
+    -- Note [...TODO]: Use stable name comparison to guarantee non-determinism of uniques doesn't influence the order of IdLabels in eg data sections or symbol table.
+    stableNameCmp a1 a2 S.<>
     compare b1 b2 S.<>
     compare c1 c2
   compare (CmmLabel a1 b1 c1 d1) (CmmLabel a2 b2 c2 d2) =



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dd74409aa3889dc7a4353b8e1687721448d72116
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/20240524/4bd30f31/attachment.html>


More information about the ghc-commits mailing list