Commit 9208de5c authored by simonpj's avatar simonpj
Browse files

[project @ 2003-01-20 16:24:51 by simonpj]

Increase the size of a string literal; cures a simplifier loop
    when an application (f "x") appeared to have size 1, and so was
    inlined repeatedly.  The problem was that "x" appeared to have
    size 0.
parent 271502ff
......@@ -289,8 +289,11 @@ litIsDupable (MachStr _) = False
litIsDupable other = True
litSize :: Literal -> Int
-- used by CoreUnfold.sizeExpr
litSize (MachStr str) = lengthFS str `div` 4
-- Used by CoreUnfold.sizeExpr
litSize (MachStr str) = 1 + (lengthFS str `div` 4)
-- Every literal has size at least 1, otherwise
-- f "x"
-- might be too small
litSize _other = 1
\end{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment