StgRhsClosure freevar and argument name duplicates

Simon Peyton Jones simonpj at microsoft.com
Mon Nov 5 13:08:06 UTC 2018


I don’t think there should be duplicates in either. Do you have a test case that shows duplicates?

Simon

From: ghc-devs <ghc-devs-bounces at haskell.org> On Behalf Of Csaba Hruska
Sent: 04 November 2018 11:22
To: ghc-devs at haskell.org
Subject: Re: StgRhsClosure freevar and argument name duplicates

Is it possible that GHC generates STG with invalid binding semantics for certain cases that the Cmm codegen fix or ignore?
This could explain my observations.
I've checked the Stg linter source (StgLint.hs ; GHC 8.2.2 and github master) and it does not check StgRhsClosure free var and binder list at all.
And the scope checker function (addInScopeVars) does not check for duplicates.

Any thoughts?

Cheers,
Csaba

On Sat, Nov 3, 2018 at 9:53 AM Csaba Hruska <csaba.hruska at gmail.com<mailto:csaba.hruska at gmail.com>> wrote:
Hi,

Can StgRhsClosure's freevar list ([occ]) or argument list ([bndr]) contain duplicates?

Cheers,
Csaba

data GenStgRhs bndr occ
  = StgRhsClosure
        CostCentreStack         -- CCS to be attached (default is CurrentCCS)
        StgBinderInfo           -- Info about how this binder is used (see below)
        [occ]                   -- non-global free vars; a list, rather than
                                -- a set, because order is important
        !UpdateFlag             -- ReEntrant | Updatable | SingleEntry
        [bndr]                  -- arguments; if empty, then not a function;
                                -- as above, order is important.
        (GenStgExpr bndr occ)   -- body

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20181105/e101bc71/attachment.html>


More information about the ghc-devs mailing list