id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
1261	optLevelFlags is not monotonic	Stefan O'Rear <stefanor@…>		"GHC 6.7.20070213 and all later versions I have fail to unbox this:

{{{
stefan@stefans:~/memset$ cat Memtest.hs
import Foreign

wset :: Int -> Int -> Ptr Int -> IO ()
wset x y z | x `seq` y `seq` z `seq` False = undefined
wset  0 vl pt = return ()
wset ct vl pt = poke pt vl >> wset (ct - 1) vl (pt `advancePtr` 1)

main = mallocArray (2^26) >>= wset (2^26) 42

with a resultant 15x performance regression:

stefan@stefans:~/memset$ ghc-6.7.20070213 -O3 Memtest.hs ; time ./a.out

real    0m5.774s
user    0m4.904s
sys     0m0.768s
stefan@stefans:~/memset$ ghc-6.6 -O3 Memtest.hs ; time ./a.out

real    0m1.043s
user    0m0.304s
sys     0m0.724s
}}}

(Toggling -fasm/-fvia-C makes no appreciable difference.)"	bug	closed	high	6.8.1	Compiler	6.7	fixed			Linux	x86		Easy (less than 1 hour)				
