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,259
    • Issues 5,259
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 565
    • Merge requests 565
  • 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
  • #503
Closed
Open
Issue created Dec 28, 2000 by Manuel M T Chakravarty@mchakravartyReporter

ByteArray# return value can lead to trouble

GHC in some circumstances has problems with functions 
returning values of type `ByteArray#'.  The following is
bogus code, but it shouldn't result in a panic:

module Test
where
import PrelGHC
import PrelBase
import PrelST

die :: Int -> ByteArray#
{-# NOINLINE die #-}
die _ = undefined

foo = I# (indexIntArray# (die 0) 0#)

With GHC 4.11 (couple of weeks old), I get

  ghc: panic! (the `impossible' happened):
  	  mkPrimReturnCode: Upd c_sPk

when compiling with

  ghc -c -O -fglasgow-exts test.hs

For the problem to occur, both -O and the NOINLINE pragma are 
required.
Trac metadata
Trac field Value
Version None
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedFixed
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