Ticket #3234 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

foldr/single no longer firing in GHC 6.10

Reported by: r6 Owned by:
Priority: normal Milestone: 6.12.1
Component: Compiler Version: 6.10.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: simplCore/should_compile/T3234 Blocked By:
Blocking: Related Tickets:

Description

consider the following module

module Foo where x = ['x']++"haskell"

when ghc --make -O2 Foo.hs -ddump-simpl-stats is run using GHC 6.8.2, the output show that the foldr/single rule is fired

5 RuleFired
    1 ++
    1 augment/build
    1 foldr/single
    1 unpack
    1 unpack-list

However, I am told that this does not happen in GHC 6.10.2 nor GHC 6.10.3 where foldr/app is fired instead

6 RuleFired
     1 ++
     1 augment/build
     1 fold/build
     1 foldr/app
     1 unpack
     1 unpack-list

Thus it appears that the above module is no longer properly optimized in GHC 6.10

(thanks to dons and Jedai for helping with this)

Change History

Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.12.1

Thanks for the report, we'll take a look

Changed 4 years ago by simonpj

  • status changed from new to closed
  • testcase set to simplCore/should_compile/T3234
  • resolution set to fixed

I fixed this as part of the big INLINE patch. The relevant note is in Desugar.lhs, namely Note [Desugaring RULE left hand sides].

I've added a test too.

Simon

Note: See TracTickets for help on using tickets.