[GHC] #7411: Exceptions are optimized away in certain situations

GHC ghc-devs at haskell.org
Tue May 8 15:09:59 UTC 2018


#7411: Exceptions are optimized away in certain situations
-------------------------------------+-------------------------------------
        Reporter:  SimonHengel       |                Owner:  tdammers
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  7.6.1
      Resolution:                    |             Keywords:  seq, deepseq,
                                     |  evaluate, exceptions
Operating System:  Linux             |         Architecture:  x86_64
                                     |  (amd64)
 Type of failure:  Incorrect result  |            Test Case:
  at runtime                         |  simplCore/should_fail/T7411
      Blocked By:                    |             Blocking:
 Related Tickets:  #5129             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by tdammers):

 Replying to [comment:20 tdammers]:
 > Interestingly, the patch from #5129 does *not* fix this one too, so it's
 not just due to incorrectly optimizing `seq` away; there is more happening
 here.

 Following the #5129 lead, I added some trace logging to the code touched
 in #5129; specifically I trapped this case:

 {{{
         | SeqOp <- op
         -> all (expr_ok primop_ok) args
 }}}
 ...which is what caught the `seq#` instances that were inappropriately
 optimized away previously.

 However, for the offending examples, this trap doesn't fire, which means
 we're not hitting the `SeqOp` case at all. So apparently the `seq` call
 gets optimized away at an earlier stage.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7411#comment:23>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list