id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
4346	Behaviour of INLINABLE depends on whether the modules included are already compiled.	milan	simonmar	"When investigating containers performance, I came across the following problem:

My Data.Map annotates nearly every method as INLINABLE. My main module Main.hs is trivial:
{{{
import Data.Map as M

main = print $ M.lookup 5 $ foldr (\x -> insert x x) empty [1..100]
}}}

Suppose my tree contains only .hs files, no .hi or .o. I can compile either by
  - {{{ghc --make -c -O Main.hs}}}, which compiles Data/Map.hs automatically, or
  - {{{ghc --make -c -O Data/Map.hs && ghc --make -c -O Main.hs}}}, which compiles Data/Map.hs explicitely with the same arguments first.

Expected result of both compilations: Main.o is the same.

Actual result: in the first case, {{{Data.Map.lookup}}} method does not get inlined in Main.o, but in the second case the {{{Data.Map.lookup}}} method gets inlined in Main.o.

If affects both ghc-7.0 and ghc-head branches.

I am not sure this is a bug, but I would definitely expect both of the compilation methods to yield the same file.

The self-contained source tree is attached."	bug	closed	high	7.0.1	Compiler	7.1	fixed		simonpj	Unknown/Multiple	Unknown/Multiple	None/Unknown					
