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,242
    • Issues 4,242
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 387
    • Merge Requests 387
  • 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
  • #2249

Closed
Open
Opened Apr 29, 2008 by millenix@trac-millenix

Undeclared variable in cmm reports as panic

In CMM code, if one makes an assignment to a variable that's not been declared, the compiler panics, in addition to reporting an almost sensible error message.

Here's code to make it happen:

testingbug
{
  var = 1;
}

And here's the output it causes:

ghc-6.9.20080305: panic! (the 'impossible' happened)
  (GHC version 6.9.20080305 for x86_64-unknown-linux):
	CmmParse: var not a register

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

I see two problems here:

  1. As the output notes, the compiler should not panic just because the user fed it noticeably bad code. It should just report the underlying message, with a line/column reference to the offending code.
  2. The error message should quote the variable name about which it's complaining. When I initially discovered this, the variable name in question was data, and that was rather confusing.
Trac metadata
Trac field Value
Version 6.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
6.12.3
Milestone
6.12.3
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#2249