Skip to content

GitLab

  • Menu
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 4,869
    • Issues 4,869
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • 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 Compiler
  • GHCGHC
  • Issues
  • #7215
Closed
Open
Created Sep 04, 2012 by takano-akio@takano-akioReporter

miscompilation due to broken interface hash

The following script should print '!MyFalse !MyTrue' but it prints '!MyFalse !MyFalse'. (warning: it removes files in the current directory)

rm -f main main.o main.hi MyBool.hi MyBool.o Foo.hi Foo.o

ghc=ghc
echo 'module MyBool where data MyBool = MyFalse | MyTrue deriving Show' > MyBool.hs
echo 'module Foo where import MyBool; foo = MyFalse' > Foo.hs
echo 'import Foo; main = print foo' > main.hs
$ghc -c -O2 MyBool.hs
$ghc -c -O2 Foo.hs
$ghc -O2 main.hs
./main
echo 'module Foo where import MyBool; foo = MyTrue' > Foo.hs
$ghc -c -O2 Foo.hs
$ghc -O2 main.hs
./main

The issue seems to be that the second version of Foo.hs gets the same interface hash as the old one. This stops GHC from updating Foo.hi, which contains an outdated unfolding.

Trac metadata
Trac field Value
Version 7.4.2
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