Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,249
    • Issues 5,249
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 576
    • Merge requests 576
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #5779
Closed
Open
Issue created Jan 15, 2012 by rl@cse.unsw.edu.au@trac-rl

SPECIALISE pragma generates wrong activations

It seems that in the current HEAD, the SPECIALISE pragma generates a rule with the same activation as the function that is being specialised which is utterly wrong. A small example:

foo :: Num a => a -> a
{-# NOINLINE foo #-}
foo x = x+1

{-# SPECIALISE foo :: Int -> Int #-}

The HEAD generates this rule which never fires:

"SPEC T.foo" [NEVER] forall $dNum :: GHC.Num.Num GHC.Types.Int
  T.foo @ GHC.Types.Int $dNum = T.foo_foo

If I change the NOINLINE pragma to INLINE [0], the rule will get the activation [0]. 7.2.2 behaves as expected:

"SPEC T.foo" [ALWAYS] forall $dNum :: GHC.Num.Num GHC.Types.Int
  T.foo @ GHC.Types.Int $dNum = T.foo_foo

I haven't checked 7.4 but if this happens there, too, then fixing it before the release would be great. I assume it's just a typo somewhere.

Trac metadata
Trac field Value
Version 7.5
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking