FloatRep and DoubleRep ADT Argument in STG

Ömer Sinan Ağacan omeragacan at gmail.com
Wed Jan 22 14:20:29 UTC 2020

What is the problem you're having? What do you mean by "run into problems"?
What's going wrong?

It'd be helpful if you could show us your program in STG syntax.

> Is it valid to use FloatRep argument in a boxed ADT on 64 bit?

It should be valid, yes.

I'd also try with `-dstg-lint -dcmm-lint`.


Csaba Hruska <csaba.hruska at gmail.com>, 22 Oca 2020 Çar, 14:56
tarihinde şunu yazdı:
> Hello,
> I try to use GHC backend via STG. For that reason I build small STG program AST maually. So far the generated programs worked fine (compile/link/run).
> However I run into problems when a lifted ADT has a FloatRep argument.
> Interestingly it works for DoubleRep.
> I'm using GHC 8.6.1 64 bit to generate the code for the constructed STG AST.
> I wonder if I break an invariant or is this actually a bug?
> Is it valid to use FloatRep argument in a boxed ADT on 64 bit?
> I made a gist with the Haskell source and the generated Cmm code is also included.
> https://gist.github.com/csabahruska/e9e143390c863f7b10b0298a7ae80ac1
> Working program (DoubleRep):
> https://gist.github.com/csabahruska/e9e143390c863f7b10b0298a7ae80ac1#file-stgsample-hs-L134-L198
> Wrong program (FloatRep):
> https://gist.github.com/csabahruska/e9e143390c863f7b10b0298a7ae80ac1#file-stgsample-hs-L64-L132
> Thanks,
> Csaba
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

More information about the ghc-devs mailing list