Skip to content

Validate using ghc-6.4.1: 3 failures, 1 workaround, 1 fix

Using

$ uname -a
Linux linux 2.6.13-15-default #1 Tue Sep 13 14:56:15 UTC 2005 i686 i686 i386 GNU/Linux
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.4.1

to validate a recent HEAD, I get the following error:

/home/tn/tn/install/ghc-6.4.1/bin/ghc -Werror -H64m -Onot -fasm  -istage1/utils  -istage1/basicTypes  -istage1/types  -istage1/hsSyn  -istage1/prelude  -istage1/rename  -istage1/typecheck  -istage1/deSugar  -istage1/coreSyn  -istage1/vectorise  -istage1/specialise  -istage1/simplCore  -istage1/stranal  -istage1/stgSyn  -istage1/simplStg  -istage1/codeGen  -istage1/main  -istage1/profiling  -istage1/parser  -istage1/cprAnalysis  -istage1/iface  -istage1/cmm  -istage1/nativeGen -Wall -fno-warn-name-shadowing -fno-warn-orphans -Istage1 -cpp -fglasgow-exts -fno-generics -Rghc-timing -I. -Iparser -package unix -ignore-package lang -recomp -Rghc-timing -O -fasm -H16M '-#include "cutils.h"' -DUSING_COMPAT -i../compat -ignore-package Cabal    -c utils/Util.lhs -o stage1/utils/Util.o  -ohi stage1/utils/Util.hi

utils/Util.lhs:204:0:
    Warning: Pattern match(es) are non-exhaustive
             In the definition of `zipLazy': Patterns not matched: (_ : _) []
<<ghc: 58855920 bytes, 15 GCs, 2212413/4501796 avg/max bytes residency (3 samples), 17M in use, 0.00 INIT (0.00 elapsed), 0.26 MUT (0.47 elapsed), 0.18 GC (0.18 elapsed) :ghc>>
make[1]: *** [stage1/utils/Util.o] Error 1
make[1]: *** Waiting for unfinished jobs....
<<ghc: 167578860 bytes, 32 GCs, 3776121/8663972 avg/max bytes residency (4 samples), 21M in use, 0.00 INIT (0.00 elapsed), 1.01 MUT (4.35 elapsed), 0.34 GC (0.42 elapsed) :ghc>>
make: *** [stage1] Error 1

Offhand, I was not able to find a correction to this problem that was also found acceptanble by the stage2 (GHC-6.9-ish) compiler, so I simply ended up working around by disabling warnings, as indicated in first of the attached patches. Which should not, I stress, be taken as my suggested solution, simply as a way of getting ahead with the validate. (I am sure that a suitable solution can be found by the appropriate experts, as needed.)

In any case, with this workaround in place, I get:

/home/tn/tn/install/ghc-6.4.1/bin/ghc -Werror -H64m -Onot -fasm  -istage1/utils  -istage1/basicTypes  -istage1/types  -istage1/hsSyn  -istage1/prelude  -istage1/rename  -istage1/typecheck  -istage1/deSugar  -istage1/coreSyn  -istage1/vectorise  -istage1/specialise  -istage1/simplCore  -istage1/stranal  -istage1/stgSyn  -istage1/simplStg  -istage1/codeGen  -istage1/main  -istage1/profiling  -istage1/parser  -istage1/cprAnalysis  -istage1/iface  -istage1/cmm  -istage1/nativeGen -Wall -fno-warn-name-shadowing -fno-warn-orphans -Istage1 -cpp -fglasgow-exts -fno-generics -Rghc-timing -I. -Iparser -package unix -ignore-package lang -recomp -Rghc-timing -O -fasm -H16M '-#include "cutils.h"' -DUSING_COMPAT -i../compat -ignore-package Cabal    -c basicTypes/OccName.lhs -o stage1/basicTypes/OccName.o  -ohi stage1/basicTypes/OccName.hi

basicTypes/OccName.lhs:86:0:
    Warning: Definition but no type signature for `isSymbol'
<<ghc: 41214864 bytes, 13 GCs, 2506893/5285948 avg/max bytes residency (3 samples), 17M in use, 0.00 INIT (0.00 elapsed), 0.16 MUT (0.96 elapsed), 0.15 GC (0.18 elapsed) :ghc>>
make[1]: *** [stage1/basicTypes/OccName.o] Error 1
make[1]: *** Waiting for unfinished jobs....
<<ghc: 131369196 bytes, 26 GCs, 3908833/8205996 avg/max bytes residency (4 samples), 20M in use, 0.00 INIT (0.00 elapsed), 0.78 MUT (1.70 elapsed), 0.32 GC (0.31 elapsed) :ghc>>
make: *** [stage1] Error 1

And this time, the attached patch that eliminates this warning could be found to be the actual solution to the problem.

Unfortunately, even with the second patch in place, I get:

/home/tn/tn/install/ghc-6.4.1/bin/ghc -Werror -H64m -Onot -fasm  -istage1/utils  -istage1/basicTypes  -istage1/types  -istage1/hsSyn  -istage1/prelude  -istage1/rename  -istage1/typecheck  -istage1/deSugar  -istage1/coreSyn  -istage1/vectorise  -istage1/specialise  -istage1/simplCore  -istage1/stranal  -istage1/stgSyn  -istage1/simplStg  -istage1/codeGen  -istage1/main  -istage1/profiling  -istage1/parser  -istage1/cprAnalysis  -istage1/iface  -istage1/cmm  -istage1/nativeGen -Wall -fno-warn-name-shadowing -fno-warn-orphans -Istage1 -cpp -fglasgow-exts -fno-generics -Rghc-timing -I. -Iparser -package unix -ignore-package lang -recomp -Rghc-timing -O -fasm -H16M '-#include "cutils.h"' -DUSING_COMPAT -i../compat -ignore-package Cabal    -c cmm/ZipDataflow.hs -o stage1/cmm/ZipDataflow.o  -ohi stage1/cmm/ZipDataflow.hi

cmm/ZipDataflow.hs:285:0:
    Contexts differ in length
    When matching the contexts of the signatures for
      fwd_pure_anal :: forall m l a.
                       (DebugNodes m l, Outputable a) =>
                       PassName
                       -> BlockEnv a
                       -> ForwardTransfers m l a
                       -> a
                       -> Graph m l
                       -> DFM a (ForwardFixedPoint m l a ())
      forward_sol :: forall m l (g :: * -> * -> *) a.
                     (DebugNodes m l, LastNode l, Outputable a) =>
                     (forall a. Fuel -> Maybe a -> Maybe a)
                     -> (g m l -> DFM a (Graph m l))
                     -> RewritingDepth
                     -> PassName
                     -> BlockEnv a
                     -> ForwardTransfers m l a
                     -> ForwardRewrites m l a g
                     -> a
                     -> Graph m l
                     -> Fuel
                     -> DFM a (ForwardFixedPoint m l a (), Fuel)
    The signature contexts in a mutually recursive group should all be identical

cmm/ZipDataflow.hs:309:19:
    GHC internal error: `a' is not in scope
    In the type signature:
      forw :: RewritingDepth
              -> PassName
                 -> BlockEnv a
                    -> ForwardTransfers m l a
                       -> ForwardRewrites m l a g
                          -> a -> Graph m l -> Fuel -> DFM a (ForwardFixedPoint m l a (), Fuel)
    In the definition of `forward_sol':
        forward_sol check_maybe return_graph
                      = forw
                      where
                          forw ::
                              RewritingDepth
                              -> PassName
                                 -> BlockEnv a
                                    -> ForwardTransfers m l a
                                       -> ForwardRewrites m l a g
                                          -> a -> Graph m l -> Fuel -> DFM a (ForwardFixedPoint m l a (), Fuel)
                          forw rewrite name start_facts transfers rewrites
                                 = let
                                     either_last rewrites in' (LastExit) = ...
                                     either_last rewrites in' (LastOther l) = ...
                                     anal_f :: DFM a b -> a -> Graph m l -> DFM a b
                                     anal_f finish in' g = ...
                                     solve :: DFM a b -> a -> Graph m l -> Fuel -> DFM a (b, Fuel)
                                     solve_tail in' (ZTail m t) fuel = ...
                                     solve_tail in' (ZLast l) fuel = ...
                                     solve finish in_fact (Graph entry blockenv) fuel = ...
                                     fixed_point in_fact g fuel = ...
                                   in fixed_point

cmm/ZipDataflow.hs:317:21:
    GHC internal error: `a' is not in scope
    In the type signature: anal_f :: DFM a b -> a -> Graph m l -> DFM a b
    In the definition of `forw':
        forw rewrite name start_facts transfers rewrites
               = let
                   either_last rewrites in' (LastExit) = fr_exit rewrites in'
                   either_last rewrites in' (LastOther l) = fr_last rewrites in' l
                   anal_f :: DFM a b -> a -> Graph m l -> DFM a b
                   anal_f finish in' g
                            = do
                                ...
                                ...
                   solve :: DFM a b -> a -> Graph m l -> Fuel -> DFM a (b, Fuel)
                   solve_tail in' (ZTail m t) fuel
                                = case ... of
                                    Nothing -> ...
                                    Just g -> ...
                   solve_tail in' (ZLast l) fuel
                                = case ... of
                                    Nothing -> ...
                                    Just g -> ...
                   solve finish in_fact (Graph entry blockenv) fuel = let ... in ...
                   fixed_point in_fact g fuel
                                 = do
                                     ...
                                     (a, fuel) <- ...
                                     facts <- ...
                                     last_outs <- ...
                                     let ...
                                     let ...
                                     ...
                 in fixed_point
    In the definition of `forward_sol':
        forward_sol check_maybe return_graph
                      = forw
                      where
                          forw ::
                              RewritingDepth
                              -> PassName
                                 -> BlockEnv a
                                    -> ForwardTransfers m l a
                                       -> ForwardRewrites m l a g
                                          -> a -> Graph m l -> Fuel -> DFM a (ForwardFixedPoint m l a (), Fuel)
                          forw rewrite name start_facts transfers rewrites
                                 = let
                                     either_last rewrites in' (LastExit) = ...
                                     either_last rewrites in' (LastOther l) = ...
                                     anal_f :: DFM a b -> a -> Graph m l -> DFM a b
                                     anal_f finish in' g = ...
                                     solve :: DFM a b -> a -> Graph m l -> Fuel -> DFM a (b, Fuel)
                                     solve_tail in' (ZTail m t) fuel = ...
                                     solve_tail in' (ZLast l) fuel = ...
                                     solve finish in_fact (Graph entry blockenv) fuel = ...
                                     fixed_point in_fact g fuel = ...
                                   in fixed_point

cmm/ZipDataflow.hs:321:20:
    GHC internal error: `a' is not in scope
    In the type signature:
      solve :: DFM a b -> a -> Graph m l -> Fuel -> DFM a (b, Fuel)
    In the definition of `forw':
        forw rewrite name start_facts transfers rewrites
               = let
                   either_last rewrites in' (LastExit) = fr_exit rewrites in'
                   either_last rewrites in' (LastOther l) = fr_last rewrites in' l
                   anal_f :: DFM a b -> a -> Graph m l -> DFM a b
                   anal_f finish in' g
                            = do
                                ...
                                ...
                   solve :: DFM a b -> a -> Graph m l -> Fuel -> DFM a (b, Fuel)
                   solve_tail in' (ZTail m t) fuel
                                = case ... of
                                    Nothing -> ...
                                    Just g -> ...
                   solve_tail in' (ZLast l) fuel
                                = case ... of
                                    Nothing -> ...
                                    Just g -> ...
                   solve finish in_fact (Graph entry blockenv) fuel = let ... in ...
                   fixed_point in_fact g fuel
                                 = do
                                     ...
                                     (a, fuel) <- ...
                                     facts <- ...
                                     last_outs <- ...
                                     let ...
                                     let ...
                                     ...
                 in fixed_point
    In the definition of `forward_sol':
        forward_sol check_maybe return_graph
                      = forw
                      where
                          forw ::
                              RewritingDepth
                              -> PassName
                                 -> BlockEnv a
                                    -> ForwardTransfers m l a
                                       -> ForwardRewrites m l a g
                                          -> a -> Graph m l -> Fuel -> DFM a (ForwardFixedPoint m l a (), Fuel)
                          forw rewrite name start_facts transfers rewrites
                                 = let
                                     either_last rewrites in' (LastExit) = ...
                                     either_last rewrites in' (LastOther l) = ...
                                     anal_f :: DFM a b -> a -> Graph m l -> DFM a b
                                     anal_f finish in' g = ...
                                     solve :: DFM a b -> a -> Graph m l -> Fuel -> DFM a (b, Fuel)
                                     solve_tail in' (ZTail m t) fuel = ...
                                     solve_tail in' (ZLast l) fuel = ...
                                     solve finish in_fact (Graph entry blockenv) fuel = ...
                                     fixed_point in_fact g fuel = ...
                                   in fixed_point

cmm/ZipDataflow.hs:371:43:
    Occurs check: cannot construct the infinite type: f = LastOutFacts f
      Expected type: DFM f f
      Inferred type: DFM f (LastOutFacts f)
    In the first argument of `solve', namely `lastOutFacts'
    In a case alternative:
        RewriteDeep -> solve lastOutFacts in' g (oneLessFuel fuel)

cmm/ZipDataflow.hs:497:64:
    Couldn't match the rigid variable `a' against `()'
      `a' is bound by the type signature for `forward_rew'
      Expected type: a
      Inferred type: ()
    In the first argument of `return', namely `()'
    In the first argument of `inner_rew', namely `(return ())'

cmm/ZipDataflow.hs:584:19:
    GHC internal error: `a' is not in scope
    In the type signature:
      back :: RewritingDepth
              -> PassName
                 -> BlockEnv a
                    -> BackwardTransfers m l a
                       -> BackwardRewrites m l a g
                          -> Graph m l -> a -> Fuel -> DFM a (BackwardFixedPoint m l a (), Fuel)
    In the definition of `backward_sol':
        backward_sol check_maybe return_graph
                       = back
                       where
                           back ::
                               RewritingDepth
                               -> PassName
                                  -> BlockEnv a
                                     -> BackwardTransfers m l a
                                        -> BackwardRewrites m l a g
                                           -> Graph m l -> a -> Fuel -> DFM a (BackwardFixedPoint m l a (), Fuel)
                           back rewrite name start_facts transfers rewrites
                                  = let
                                      anal_b :: Graph m l -> a -> DFM a a
                                      anal_b g out = ...
                                      subsolve :: g m l -> a -> Fuel -> DFM a (a, Fuel)
                                      solve :: Graph m l -> a -> Fuel -> DFM a (a, Fuel)
                                      subsolve = ...
                                      solve (Graph entry blockenv) exit_fact fuel = ...
                                      set_head_fact (ZFirst id) a fuel = ...
                                      set_head_fact (ZHead h m) a fuel = ...
                                      fixed_point g exit_fact fuel = ...
                                    in fixed_point

cmm/ZipDataflow.hs:592:23:
    GHC internal error: `m' is not in scope
    In the type signature: anal_b :: Graph m l -> a -> DFM a a
    In the definition of `back':
        back rewrite name start_facts transfers rewrites
               = let
                   anal_b :: Graph m l -> a -> DFM a a
                   anal_b g out
                            = do
                                fp <- ...
                                ...
                   subsolve :: g m l -> a -> Fuel -> DFM a (a, Fuel)
                   solve :: Graph m l -> a -> Fuel -> DFM a (a, Fuel)
                   subsolve = case ... of
                                RewriteDeep -> ...
                                RewriteShallow -> ...
                   solve (Graph entry blockenv) exit_fact fuel = let ... in ...
                   set_head_fact (ZFirst id) a fuel
                                   = case ... of
                                       Nothing -> ...
                                       Just g -> ...
                   set_head_fact (ZHead h m) a fuel
                                   = case ... of
                                       Nothing -> ...
                                       Just g -> ...
                   fixed_point g exit_fact fuel
                                 = do
                                     ...
                                     (a, fuel) <- ...
                                     facts <- ...
                                     let ...
                                     ...
                 in fixed_point
    In the definition of `backward_sol':
        backward_sol check_maybe return_graph
                       = back
                       where
                           back ::
                               RewritingDepth
                               -> PassName
                                  -> BlockEnv a
                                     -> BackwardTransfers m l a
                                        -> BackwardRewrites m l a g
                                           -> Graph m l -> a -> Fuel -> DFM a (BackwardFixedPoint m l a (), Fuel)
                           back rewrite name start_facts transfers rewrites
                                  = let
                                      anal_b :: Graph m l -> a -> DFM a a
                                      anal_b g out = ...
                                      subsolve :: g m l -> a -> Fuel -> DFM a (a, Fuel)
                                      solve :: Graph m l -> a -> Fuel -> DFM a (a, Fuel)
                                      subsolve = ...
                                      solve (Graph entry blockenv) exit_fact fuel = ...
                                      set_head_fact (ZFirst id) a fuel = ...
                                      set_head_fact (ZHead h m) a fuel = ...
                                      fixed_point g exit_fact fuel = ...
                                    in fixed_point

cmm/ZipDataflow.hs:597:19:
    GHC internal error: `g' is not in scope
    In the type signature: subsolve :: g m l -> a -> Fuel -> DFM a (a, Fuel)
    In the definition of `back':
        back rewrite name start_facts transfers rewrites
               = let
                   anal_b :: Graph m l -> a -> DFM a a
                   anal_b g out
                            = do
                                fp <- ...
                                ...
                   subsolve :: g m l -> a -> Fuel -> DFM a (a, Fuel)
                   solve :: Graph m l -> a -> Fuel -> DFM a (a, Fuel)
                   subsolve = case ... of
                                RewriteDeep -> ...
                                RewriteShallow -> ...
                   solve (Graph entry blockenv) exit_fact fuel = let ... in ...
                   set_head_fact (ZFirst id) a fuel
                                   = case ... of
                                       Nothing -> ...
                                       Just g -> ...
                   set_head_fact (ZHead h m) a fuel
                                   = case ... of
                                       Nothing -> ...
                                       Just g -> ...
                   fixed_point g exit_fact fuel
                                 = do
                                     ...
                                     (a, fuel) <- ...
                                     facts <- ...
                                     let ...
                                     ...
                 in fixed_point
    In the definition of `backward_sol':
        backward_sol check_maybe return_graph
                       = back
                       where
                           back ::
                               RewritingDepth
                               -> PassName
                                  -> BlockEnv a
                                     -> BackwardTransfers m l a
                                        -> BackwardRewrites m l a g
                                           -> Graph m l -> a -> Fuel -> DFM a (BackwardFixedPoint m l a (), Fuel)
                           back rewrite name start_facts transfers rewrites
                                  = let
                                      anal_b :: Graph m l -> a -> DFM a a
                                      anal_b g out = ...
                                      subsolve :: g m l -> a -> Fuel -> DFM a (a, Fuel)
                                      solve :: Graph m l -> a -> Fuel -> DFM a (a, Fuel)
                                      subsolve = ...
                                      solve (Graph entry blockenv) exit_fact fuel = ...
                                      set_head_fact (ZFirst id) a fuel = ...
                                      set_head_fact (ZHead h m) a fuel = ...
                                      fixed_point g exit_fact fuel = ...
                                    in fixed_point

cmm/ZipDataflow.hs:653:0:
    Contexts differ in length
    When matching the contexts of the signatures for
      backward_sol :: forall m l (g :: * -> * -> *) a.
                      (DebugNodes m l, LastNode l, Outputable a) =>
                      (forall a. Fuel -> Maybe a -> Maybe a)
                      -> (g m l -> DFM a (Graph m l))
                      -> RewritingDepth
                      -> PassName
                      -> BlockEnv a
                      -> BackwardTransfers m l a
                      -> BackwardRewrites m l a g
                      -> Graph m l
                      -> a
                      -> Fuel
                      -> DFM a (CommonFixedPoint m l a (), Fuel)
      bwd_pure_anal :: forall m l a.
                       (DebugNodes m l, Outputable a) =>
                       PassName
                       -> BlockEnv a
                       -> BackwardTransfers m l a
                       -> Graph m l
                       -> a
                       -> DFM a (CommonFixedPoint m l a ())
    The signature contexts in a mutually recursive group should all be identical
<<ghc: 71502392 bytes, 17 GCs, 2318038/4641952 avg/max bytes residency (3 samples), 18M in use, 0.00 INIT (0.00 elapsed), 0.33 MUT (1.15 elapsed), 0.20 GC (0.40 elapsed) :ghc>>
make[1]: *** [stage1/cmm/ZipDataflow.o] Error 1
make[1]: *** Waiting for unfinished jobs....
<<ghc: 604556240 bytes, 1433 GCs, 9880866/17582144 avg/max bytes residency (8 samples), 47M in use, 0.00 INIT (0.01 elapsed), 3.54 MUT (7.19 elapsed), 2.30 GC (4.76 elapsed) :ghc>>
make: *** [stage1] Error 1

And that is the state of affairs as I report this.

Best regards Thorkil

Trac metadata
Trac field Value
Version 6.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information