[GHC] #8742: Reuse scavenge_small_bitmap

GHC ghc-devs at haskell.org
Thu Feb 13 14:29:58 UTC 2014


#8742: Reuse scavenge_small_bitmap
-------------------------------------+------------------------------------
        Reporter:  Tarrasch          |            Owner:
            Type:  task              |           Status:  new
        Priority:  lowest            |        Milestone:  7.10.1
       Component:  Runtime System    |          Version:  7.6.3
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by Tarrasch):

 Nevermind, I'm just forgetting that I'm stupid. I spent a lot of time
 experimenting and trying to create a minimal test-case where gcc isn't
 able to inline. Tough  it turned out that my premise was wrong all along,
 it isn't equivalent to inline the code due to the implicit type casts.

 It so happens that in `scavenge_arg_block` and `scavenge_stack` the `size`
 argument is of type `nat`. For these two cases the `STATIC_INLINE` and
 explicit inline methods created exactly identical object files. But for
 the function `scavenge_PAP_payload` the variable (actually parameter) with
 the same name `size` had type `StgWord`. To make this even worse
 confusing, the passed argument to `scavenge_PAP_payload` is of type
 `StgHalfWord`. Phew.

 My suggested resolution is to first apply a patch changing the type
 signature of `scavenge_PAP_payload` to take a `nat` instead of an
 `StgWord`. I'll attach a patch.

 After that the original patch should be merge-able without changing the
 output of the object files. :)


 ----

 Oh god, I wasted *so much time* on this, for what it's worth, here are
 some gists I produced in the meantime:

 https://gist.github.com/Tarrasch/8965562

 https://gist.github.com/Tarrasch/8966086

 https://gist.github.com/Tarrasch/8971992

 https://gist.github.com/Tarrasch/8972574

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


More information about the ghc-tickets mailing list