Ticket #5929 (closed bug: fixed)

Opened 15 months ago

Last modified 13 months ago

Exciting arity warning when compiling with optimizations

Reported by: passalaqua Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.1
Keywords: Exciting arity Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

When trying to compile a file generated by UUAG ( http://www.cs.uu.nl/wiki/HUT/AttributeGrammarSystem) using optimizations on GHC 7.2.1 (Windows), 7.2.2 (Mac) or 7.4.1 (Windows) I get a line that says only "Exciting arity" followed by some GHC internal code (maybe GHC Core?).

The code still compiles and executes as expected, however this warning clearly indicates that something (either in the code or in ghc) is not working as expected.

Changing the code sometimes eliminates that warning, sometimes it doesn't. The version attached was the smallest I could get that still got me the warnings (and does not depend on any 3rd party libraries, if anyone's interested in reproducing it).

Attachments

TypeCheck.hs Download (4.5 KB) - added by passalaqua 15 months ago.
Code that triggers the warning.
warnings.log Download (17.0 KB) - added by passalaqua 15 months ago.
Copy of the output that is generated by GHC
0001-Enable-dno-debug-output-if-GHC-is-compiled-w-o-DEBUG.patch Download (0.8 KB) - added by michalt 13 months ago.

Change History

Changed 15 months ago by passalaqua

Code that triggers the warning.

Changed 15 months ago by passalaqua

Copy of the output that is generated by GHC

Changed 13 months ago by michalt

I've just looked at the code for arity analysis and it seems to work just fine. This doesn't seem to be a warning but a debugging message comming from a pprTrace whenever the fixed-point algorith for arity analysis goes for more than one iteration. I thought that pprTrace should be disabled by default, but it is defined as

pprTrace :: String -> SDoc -> a -> a
-- ^ If debug output is on, show some 'SDoc' on the screen
pprTrace str doc x
   | opt_NoDebugOutput = x
   | otherwise         = pprDebugAndThen trace str doc x

and

opt_NoDebugOutput   :: Bool
opt_NoDebugOutput               = lookUp  (fsLit "-dno-debug-output")

which, as far as I can see, means that pprTrace will print something unless the user specifies -dno-debug-output. IOW it will be enabled by default.

The attached patch enables the -dno-debug-output if GHC is compiled without DEBUG. Also we could consider adding a flag to enable debug output (i.e. the opposite of -dno-debug-output), such as -ddebug-output.

Changed 13 months ago by simonmar

  • difficulty set to Unknown

What we normally do is put calls to pprTrace inside #ifdef DEBUG, that would be an easy fix here. The point of -dno-debug-output is so that the testsuite still works with a DEBUG compiler.

Changed 13 months ago by simonpj

I'll action this. Thanks for the analysis Michael. You are right.. but in the end we thought that even folk who don't build with -DDEBUG might want to use pprTrace, so we'll use SimonM's plan, which is the way we handle it elsewhere.

Simon

Changed 13 months ago by simonpj@…

commit 95fb4b1da70a9df50a42449b19ff6350181a38db

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Fri Apr 27 17:42:22 2012 +0100

    Comment out a pprTrace unless DEBUG is on (fix Trac #5929)

 compiler/simplCore/SimplUtils.lhs |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Changed 13 months ago by simonpj

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.