[GHC] #12125: Field accessors unnecessarily kept alive

GHC ghc-devs at haskell.org
Fri May 27 08:30:49 UTC 2016


#12125: Field accessors unnecessarily kept alive
-------------------------------------+-------------------------------------
           Reporter:  osa1           |             Owner:  osa1
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):  Phab:D2270     |         Wiki Page:
-------------------------------------+-------------------------------------
 Suppose you have a record with some non-exported field accessors, like so:

 {{{#!haskell
 module Lib (Rec) where

 data Rec = Rec
   { f1 :: Int
   , f2 :: Int
   , f3 :: Int
   , f4 :: Int
   , f5 :: Int
   }
 }}}

 Code for fields `f1`, `f2` ... are redundantly generated, optimized etc.
 and they made it to the object file, causing wasted compile times and
 bloated object files.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12125>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list