
#13916: Optimizations create run time seg faults
-------------------------------------+-------------------------------------
Reporter: newthin | Owner: (none)
Type: bug | Status: patch
Priority: highest | Milestone: 8.2.2
Component: Compiler | Version: 8.0.2
(CodeGen) |
Resolution: | Keywords: optimization
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Runtime crash | Test Case:
Blocked By: | Blocking:
Related Tickets: #8091 | Differential Rev(s): Phab:D3756
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by bgamari):
Merged to master with c940e3b92f4527ca59fcae93f36c869de3e7ccb9,
{{{
dmdAnal: Ensure that ExnStr flag isn't dropped inappropriately
This fixes #13977 and consequently #13615. Here an optimization in the
demand analyser was too liberal, causing us to drop the ExnStr flag and
consequently resulting in incorrect demand signatures. This manifested
as a segmentation fault in #13615 as we incorrectly concluded that an
application of catchRetry# would bottom.
Specifically, we had
orElse' :: STM a -> STM a -> STM a
orElse' x = catchRetry# x y
where y = {- some action -}
Where the catchRetry# primop places a demand of