Opened 6 years ago

Closed 6 years ago

#2520 closed bug (fixed)

SPECIALIZE causing duplicate assembler symbols

Reported by: ganesh Owned by: simonpj
Priority: normal Milestone:
Component: Compiler Version: 6.9
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: simplCore/should_compile/T2520 Blocked By:
Blocking: Related Tickets:


The program below causes duplicate assembler symbols when compiled -O with ghc 6.9.20080816 (but not with ghc 6.8.2)

There's no profiling involved otherwise I'd have assumed this was a duplicate of #2410.

module Types where

data Prod a b = Prod a b

data Nil = Nil

class ProdSel f where
   nil :: f Nil
   prod :: f x -> f y -> f (Prod x y)

instance ProdSel SqlFields where
   nil = SFNil
   prod = SFProd

{-# SPECIALIZE reproject :: SqlFields a -> SqlFields a #-}

reproject :: ProdSel f => SqlFields a -> f a
reproject SFNil = nil
reproject (SFProd a b) = prod (reproject a) (reproject b)

data SqlFields a where
  SFNil :: SqlFields Nil
  SFProd :: SqlFields a -> SqlFields b -> SqlFields (Prod a b)

Change History (2)

comment:1 Changed 6 years ago by simonpj

  • Difficulty set to Unknown
  • Owner set to simonpj

I'll look at this. See also #2543


comment:2 Changed 6 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to simplCore/should_compile/T2520

Fixed by

Wed Aug 27 16:27:28 BST 2008
  * Fix Trac #2520: duplicate symbols


Note: See TracTickets for help on using tickets.