Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,332
    • Issues 4,332
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 370
    • Merge Requests 370
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #13750

Closed
Open
Opened May 24, 2017 by David Feuer@treeowlReporter

GHC produces incorrect coercions in hairy code

Andres Löh has been working with an optimized version of generics-sop, and ran into segfaults. He was able to reduce the test case to the attached (still not tiny) one, and could reduce it no further. He discovered the following utterly bogus definition in -ddump-simpl (with -O):

Main.gshowP_$dAll :: All MyShow GHC.Exts.Any
[GblId,
 Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
         WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
Main.gshowP_$dAll
  = ghc-prim-0.5.0.0:GHC.Classes.$p1(%,%)
      @ (All MyShow GHC.Exts.Any)
      @ (All (All MyShow) GHC.Exts.Any)
      (ghc-prim-0.5.0.0:GHC.Classes.C:(%%)
       `cast` (Sub (Sym (Main.D:R:AllFk_c[][0] <[*]>_N <All MyShow>_N))
               ; Sym (Main.N:All[0] <[*]>_N <All MyShow>_N <'[]>_N)
               ; Sub
                   (Nth:1
                      (Sub
                         (Sym
                            (Main.D:R:AllFkc:[0] <[*]>_N <All MyShow>_N <'[Char]>_N <'[]>_N))
                       ; (AllF
                            <[*]>_N
                            <All MyShow>_N
                            ((':)
                               <[*]>_N
                               (UnsafeCo nominal '[Char] GHC.Exts.Any)
                               (UnsafeCo nominal '[] GHC.Exts.Any))_N)_R
                       ; Sub
                           (Main.D:R:AllFkc:[0]
                              <[*]>_N <All MyShow>_N <GHC.Exts.Any>_N <GHC.Exts.Any>_N)))
               ; Main.N:All[0]
                   <[*]>_N
                   <All MyShow>_N
                   (UnsafeCo nominal GHC.Exts.Any (GHC.Exts.Any : GHC.Exts.Any))
               ; Sub
                   (Main.D:R:AllFkc:[0]
                      <[*]>_N <All MyShow>_N <GHC.Exts.Any>_N <GHC.Exts.Any>_N)
               :: (() :: Constraint :: Constraint)
                  ~R#
                  ((All MyShow GHC.Exts.Any,
                    All (All MyShow) GHC.Exts.Any) :: Constraint)))
Trac metadata
Trac field Value
Version 8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC kosmikus
Operating system
Architecture
Assignee
Assign to
8.2.2
Milestone
8.2.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#13750