Opened 3 years ago

Last modified 10 months ago

#13406 new bug

IO hack in demand analyzer can miss I/O

Reported by: dfeuer Owned by:
Priority: normal Milestone: 8.10.1
Component: Compiler Version: 8.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

If someone digs into the IO type, they could (with good reason, even!) decide that they want to produce something other than an unboxed pair. Here's an example, imitating StateT st IO a in a way that's sure to be unboxed well:

newtype IOState st a = IOState
  { unIOState :: State# RealWorld
              -> st
              -> (# State# RealWorld, st, a #) }

This won't trip io_hack_reqd, so demand analysis won't see it as I/O, and everything will be wrong. Urk. Furthermore, in the future, we may allow newtypes around unlifted types, in which case this stuff gets even messier.

Change History (4)

comment:1 Changed 21 months ago by bgamari

Milestone: 8.4.18.6.1

This ticket won't be resolved in 8.4; remilestoning for 8.6. Do holler if you are affected by this or would otherwise like to work on it.

comment:2 Changed 16 months ago by bgamari

This will not be addressed in GHC 8.6.

comment:3 Changed 16 months ago by bgamari

Milestone: 8.6.18.8.1

These will not be addressed in GHC 8.6.

comment:4 Changed 10 months ago by osa1

Milestone: 8.8.18.10.1

Bumping milestones of low-priority tickets.

Note: See TracTickets for help on using tickets.