[GHC] #955: more object-code blow-up in ghc-6.8.3 vs. ghc-6.4.2 (both with optimization)

GHC trac at galois.com
Wed Jul 2 07:55:26 EDT 2008


#955: more object-code blow-up in ghc-6.8.3 vs. ghc-6.4.2 (both with
optimization)
--------------------------------------+-------------------------------------
 Reporter:  maeder at tzi.de             |          Owner:          
     Type:  run-time performance bug  |         Status:  reopened
 Priority:  high                      |      Milestone:  6.10.1  
Component:  Compiler                  |        Version:  6.8.3   
 Severity:  normal                    |     Resolution:          
 Keywords:  object-code blow-up       |     Difficulty:  Unknown 
 Testcase:                            |   Architecture:  Multiple
       Os:  Multiple                  |  
--------------------------------------+-------------------------------------
Comment (by maeder):

 changing all instances like the following from

 {{{
 instance (ShATermConvertible c,
           ShATermConvertible t) => ShATermConvertible (Q c t) where
     toShATermAux att0 ((:=>) a b) = do
         (att1, a') <- toShATerm' att0 a
         (att2, b') <- toShATerm' att1 b
         return $ addATerm (ShAAppl "(:=>)" [a',b'] []) att2
     fromShATermAux ix att0 =
         case getShATerm ix att0 of
             ShAAppl "(:=>)" [a,b] _ ->
                     case fromShATerm' a att0 of { (att1, a') ->
                     case fromShATerm' b att1 of { (att2, b') ->
                     (att2, (:=>) a' b') }}
             u -> fromShATermError "Q" u
 }}}

 to

 {{{
 _toShATermAux_Q att0 ((:=>) a b) = do
     (att1, a') <- toShATerm' att0 a
     (att2, b') <- toShATerm' att1 b
     return $ addATerm (ShAAppl "(:=>)" [a',b'] []) att2
 _fromShATermAux_Q ix att0 =
     case getShATerm ix att0 of
         ShAAppl "(:=>)" [a,b] _ ->
                 case fromShATerm' a att0 of { (att1, a') ->
                 case fromShATerm' b att1 of { (att2, b') ->
                 (att2, (:=>) a' b') }}
         u -> fromShATermError "Q" u
 instance (ShATermConvertible c,
           ShATermConvertible t) => ShATermConvertible (Q c t) where
     toShATermAux = _toShATermAux_Q
     fromShATermAux = _fromShATermAux_Q
 }}}

 avoids the blow up

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/955#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list