Opened 3 years ago

Closed 3 years ago

#7406 closed bug (fixed)

-ddump-ds does not turn on -fforce-recomp

Reported by: goldfire Owned by: igloo
Priority: normal Milestone: 7.8.1
Component: Compiler Version: 7.7
Keywords: Cc:
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

According to http://www.haskell.org/ghc/docs/7.6.1/html/users_guide/flag-reference.html, any -ddump-x flag should imply -fforce-recomp. This does not appear to be happening with 7.7.20121031.

Change History (8)

comment:1 Changed 3 years ago by simonpj

  • difficulty set to Easy (less than 1 hour)
  • Milestone set to 7.8.1
  • Owner set to igloo

comment:2 Changed 3 years ago by igloo

  • Status changed from new to infoneeded

Seems to work for me. Can you tell me how to reproduce it please?

comment:3 Changed 3 years ago by goldfire

22:51:50 ~/temp> ghc Scratch.hs
[1 of 1] Compiling Scratch          ( Scratch.hs, Scratch.o )
22:51:56 ~/temp> ghc Scratch.hs
22:51:57 ~/temp> ghc -ddump-ds Scratch.hs
22:52:03 ~/temp> ghc -ddump-ds -fforce-recomp Scratch.hs
[1 of 1] Compiling Scratch          ( Scratch.hs, Scratch.o )

==================== Desugar (after optimization) ====================
...

comment:4 Changed 3 years ago by simonmar

I noticed this too. It did work, but apparently broke at some point.

comment:5 Changed 3 years ago by igloo

  • Status changed from infoneeded to new

Ah, thanks. I was trying with

ghc -c q.hs -ddump-ds

which does recompile it. Curious, I'll take a look.

comment:6 Changed 3 years ago by igloo

OK, looks like this is deliberate:

forceRecompile :: DynP ()
-- Whenver we -ddump, force recompilation (by switching off the
-- recompilation checker), else you don't see the dump! However,
-- don't switch it off in --make mode, else *everything* gets
-- recompiled which probably isn't what you want
forceRecompile = do dfs <- liftEwM getCmdLineState
                    when (force_recomp dfs) (setGeneralFlag Opt_ForceRecomp)
        where
          force_recomp dfs = isOneShot (ghcMode dfs)

I think it would be best to just adjust the docs to match.

comment:7 Changed 3 years ago by ian@…

commit 782faec0d6cd32bc922e3d489c2d44c9ca175a3e

Author: Ian Lynagh <[email protected]>
Date:   Sat Jan 12 12:55:31 2013 +0000

    Clarify docs on when -ddump-* imply -fforce-recomp; fixes #7406

 docs/users_guide/flags.xml |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

comment:8 Changed 3 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

Docs fixed.

Note: See TracTickets for help on using tickets.