[commit: ghc] master: Fix GEq1 when optimizations are enabled (8e735fd)

git at git.haskell.org git at git.haskell.org
Tue Dec 29 13:12:46 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8e735fd0f88454b74fbb866a59b608925a2b3e48/ghc

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

commit 8e735fd0f88454b74fbb866a59b608925a2b3e48
Author: RyanGlScott <ryan.gl.scott at gmail.com>
Date:   Tue Dec 29 13:43:52 2015 +0100

    Fix GEq1 when optimizations are enabled
    
    When optimizations are enabled, primitive string literals can be
    inlined, which can create two copies of a string constant with different
    addresses. We want to avoid this behavior at all costs in the `GEq1`
    test, since the output depends on the result of `eqAddr#`. We prevent
    such inlining through use of the `{-# NOINLINE #-}` pragma.
    
    Fixes #11292.
    
    Test Plan: Validate with T11292
    
    Reviewers: thomie, austin, bgamari
    
    Reviewed By: bgamari
    
    Differential Revision: https://phabricator.haskell.org/D1714
    
    GHC Trac Issues: #11292


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

8e735fd0f88454b74fbb866a59b608925a2b3e48
 testsuite/tests/generics/GEq/GEq1.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testsuite/tests/generics/GEq/GEq1.hs b/testsuite/tests/generics/GEq/GEq1.hs
index d6ca0b0..54867db 100644
--- a/testsuite/tests/generics/GEq/GEq1.hs
+++ b/testsuite/tests/generics/GEq/GEq1.hs
@@ -46,9 +46,11 @@ f2 = F 0.0 4 'h'
 
 u0 :: U Int
 u0 = U 1 "1"# '1'# 1.0## 1.0# 1# 1##
+{-# NOINLINE u0 #-}
 
 uf0 :: UF Int Int Int
 uf0 = UF 2 2 "1"# '2'# 2.0## 2.0# 2# 2##
+{-# NOINLINE uf0 #-}
 
 -- Generic instances
 instance                   GEq C



More information about the ghc-commits mailing list