Model divergence of retry# as ThrowsExn, not Diverges

Authored by bgamari on Sep 13 2017, 11:22 AM.

Description

Model divergence of retry# as ThrowsExn, not Diverges

The demand signature of the retry# primop previously had a Diverges
result. However, this caused the demand analyser to conclude that a
program of the shape,

catchRetry# (... >> retry#)

would diverge. Of course, this is plainly wrong; catchRetry#'s sole
reason to exist is to "catch" the "exception" thrown by retry#. While
catchRetry#'s demand signature correctly had the ExnStr flag set on its
first argument, indicating that it should catch divergence, the logic
associated with this flag doesn't apply to Diverges results. This
resulted in Trac #14171.

The solution here is to treat the divergence of retry# as an exception.
Namely, give it a result type of ThrowsExn rather than Diverges.

Updates stm submodule for tests.

Test Plan: Validate with T14171

Reviewers: simonpj, austin

Subscribers: rwbarton, thomie

GHC Trac Issues: Trac #14171, Trac #8091

Differential Revision: https://phabricator.haskell.org/D3919

Details

Committed
bgamariSep 13 2017, 3:54 PM
Differential Revision
D3919: Model divergence of retry# as ThrowsExn, not Diverges
Parents
rGHC4cead3c1d5bf: rts: Add regsterCc(s)List to RTS symbols list
Branches
Unknown
Tags
Unknown