Skip to content

Poor -fspec-constr-count=n warning messages

The attached file, compiled with

ghc -O2 -fspec-constr-count=5 -ddpr-debug -c q.hs

gives a number of messages like

SpecConstr
    Function `$j_X1BO{v} [lid]'
      has one call pattern, but the limit is 0
    Use -fspec-constr-count=n to set the bound
    Use -dppr-debug to see specialisations
SpecConstr
    Function `$j_X1BR{v} [lid]'
      has two call patterns, but the limit is 1
    Use -fspec-constr-count=n to set the bound
    Use -dppr-debug to see specialisations

Note that the limit doesn't match the spec-constr-count we set.

The "limit" given is sc_count, but decreaseSpecCount changes sc_count from its default of specConstrCount dflags. However, if this was fixed then we would get even stranger messages like

      has two call patterns, but the limit is 5
Edited by Thomas Miedema
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information