From: simonpj Date: Mon, 20 Jan 2003 16:24:51 +0000 (+0000) Subject: [project @ 2003-01-20 16:24:51 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1252 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=9208de5cd7f22942c0a72d34f9716427cda97bbe;p=ghc-hetmet.git [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. --- diff --git a/ghc/compiler/basicTypes/Literal.lhs b/ghc/compiler/basicTypes/Literal.lhs index 1b794a6..f2d09f3 100644 --- a/ghc/compiler/basicTypes/Literal.lhs +++ b/ghc/compiler/basicTypes/Literal.lhs @@ -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}