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,262
    • Issues 4,262
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 419
    • Merge Requests 419
  • 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
  • #18527

Closed
Open
Opened Aug 03, 2020 by Tobias Decking@TDecki

Optimisation removes effectful computation.

Summary

The attached zip contains a small cabal package with a Win32 dependency. The problematic source file in question is Offending.hs, where the optimisation level was overridden.

Steps to reproduce

When setting the optimisation level in Offending.hs to -O1, and doing a full rebuild (running cabal clean if neccessary), the resulting program prints the following:

Sending mask: 0

Somehow, the second call to sendMessage in Offending.hs gets dropped.

Expected behavior

When setting the optimisation level in Offending.hs to -O0, the program prints the expected result:

Sending mask: 0
Recieved new mask: 2

Environment

  • GHC version used: 8.10.1

bug.zip

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#18527