Ticket #5915 (closed bug: fixed)

Opened 15 months ago

Last modified 14 months ago

Code using seq has wrong strictness when unoptimised (too strict)

Reported by: michal.palka Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.3
Keywords: seq strictness strict lazy Cc: michal.palka@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Difficulty: Unknown
Test Case: simplCore/should_run/T5915 Blocked By:
Blocking: Related Tickets:

Description

The following piece of code gets miscompiled if no optimisation is used. The program crashes instead of printing [0], which would be the correct behaviour. GHC 7.3.20111127 has been used for triggering this bug.

test = seq (seq id (\a -> undefined a))

main = do
  print $ test [0]

Change History

Changed 14 months ago by simonpj@…

commit 1802ef71cacaa4b37742458dd6e4b7df771f24ba

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Mon Mar 12 09:04:32 2012 +0000

    Fix another bug in CorePrep eta-reduction (fixes Trac #5915)
    
    CorePrep has its own eta reducer (for tiresome reasons) and it was
    being sloppy about making sure it didn't change termination behaviour.
    Thanks to Michal Palka for discovering this.

 compiler/coreSyn/CorePrep.lhs |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

Changed 14 months ago by simonpj

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to fixed
  • testcase set to simplCore/should_run/T5915

Thanks!

Changed 14 months ago by simonpj@…

commit 0741ca5c410ecf6d21796a0887213673a3ebc373

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Mon Mar 12 09:04:32 2012 +0000

    Fix another bug in CorePrep eta-reduction (fixes Trac #5915)
    
    CorePrep has its own eta reducer (for tiresome reasons) and it was
    being sloppy about making sure it didn't change termination behaviour.
    Thanks to Michal Palka for discovering this.

 compiler/coreSyn/CorePrep.lhs |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
Note: See TracTickets for help on using tickets.