#2416: Optimization defeated by merging module into main
-----------------------+----------------------------------------------------
Reporter: sedillard | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.8.3
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: x86_64 (amd64)
Os: Linux |
-----------------------+----------------------------------------------------
Comment (by sedillard):
Thanks for looking into it. It has something to do with the Storable
instance. I've noticed consistently flaky behavior from the combination of
that class and my vector data type. Until the NDP array libraries mature,
or until someone helps me with this [http://www.haskell.org/pipermail
/haskell-cafe/2008-July/044879.html], Storable is all I've got and I use
it heavily.
Originally, I meant to submit another bug, and I was trying to create a
simple test case, which is when I ran across this behavior while trying to
merge everything into one file. That original bug, also involving
Storable, is even weirder:
I have a type Vec4 a, which is polymorphic in a, and a Storable instance
for that. (Same as in this file.) I also have a specialized types, Vec2D -
Vec4D, with unpacked doubles, and functions pack/unpack which convert
between the polymorphic and specialized types. The weirdness is this: when
I declare a Storable instance for Vec2D, using pack/unpack and the
Storable methods of Vec2 a, then the optimization fails for Vec4 a's
Storable methods. The test case is the same as here, Main.hs doing many
4x4 matrix/vector multiplies. So when I define type B's Storable instance
using type A's, then optimization fails for type A's methods, even though
no values of type B are ever used. Totally bizarre. I can reproduce this,
but like I said, I ran into this here bug when trying to make a single-
file test case, so first things first I guess.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2416#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs