Opened 3 years ago

Closed 3 years ago

#6097 closed bug (fixed)

tc078(hpc,optasm,profasm) are failing with core lint errors

Reported by: igloo Owned by: simonpj
Priority: high Milestone: 7.6.1
Component: Compiler Version: 7.5
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case: tc078
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

tc078(hpc,optasm,profasm) are failing with core lint errors.

Here's the code:

-- !!! instance decls with no binds
--
module ShouldFail where

data Bar a = MkBar Int a

instance Eq a => Eq (Bar a)
instance Ord a => Ord (Bar a)

And the optasm failure:

=====> tc078(optasm) 75 of 326 [0, 0, 0]
cd . && '/home/ian/ghc/git/ghc/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-conf -rtsopts  -fno-ghci-history -c tc078.hs -O -fasm  -fno-warn-incomplete-patterns >tc078.comp.stderr 2>&1
Compile failed (status 256) errors were:
*** Core Lint errors : in result of Common sub-expression ***
<no location info>: Warning:
    [RHS of $cmax_ah8 :: forall a_ag5.
                         GHC.Classes.Ord a_ag5 =>
                         ShouldFail.Bar a_ag5
                         -> ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5]
    The type of this binder doesn't match the type of its RHS: $cmax_ah8
    Binder's type: forall a_ag5.
                   GHC.Classes.Ord a_ag5 =>
                   ShouldFail.Bar a_ag5
                   -> ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5
    Rhs type: forall a_ag5.
              GHC.Classes.Ord a_ag5 =>
              ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool
*** Offending Program ***
Rec {
$c==_agv [InlPrag=INLINE (sat-args=2), Occ=LoopBreaker]
  :: forall a_ag6.
     GHC.Classes.Eq a_ag6 =>
     ShouldFail.Bar a_ag6 -> ShouldFail.Bar a_ag6 -> GHC.Types.Bool
[LclId,
 Arity=3,
 Str=DmdType AAAb,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=True)
         Tmpl= \ (@ a_ag6)
                 ($dEq_agt [Occ=Once] :: GHC.Classes.Eq a_ag6)
                 (x_ahu [Occ=Once] :: ShouldFail.Bar a_ag6)
                 (y_ahv [Occ=Once] :: ShouldFail.Bar a_ag6) ->
                 $c==_agv @ a_ag6 $dEq_agt x_ahu y_ahv}]
$c==_agv =
  \ (@ a_ag6)
    ($dEq_agt :: GHC.Classes.Eq a_ag6)
    (eta_B2 :: ShouldFail.Bar a_ag6)
    (eta_B1 :: ShouldFail.Bar a_ag6) ->
    $c==_agv @ a_ag6 $dEq_agt eta_B2 eta_B1
end Rec }

$c/=_agz [InlPrag=INLINE (sat-args=2)]
  :: forall a_ag6.
     GHC.Classes.Eq a_ag6 =>
     ShouldFail.Bar a_ag6 -> ShouldFail.Bar a_ag6 -> GHC.Types.Bool
[LclId,
 Arity=3,
 Str=DmdType AAAb,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=True)
         Tmpl= \ (@ a_ag6)
                 ($dEq_agt [Occ=Once] :: GHC.Classes.Eq a_ag6)
                 (x_ahk [Occ=Once] :: ShouldFail.Bar a_ag6)
                 (y_ahl [Occ=Once] :: ShouldFail.Bar a_ag6) ->
                 $c==_agv @ a_ag6 $dEq_agt x_ahk y_ahl}]
$c/=_agz = $c==_agv

ShouldFail.$fEqBar [InlPrag=[ALWAYS] CONLIKE]
  :: forall a_ag6.
     GHC.Classes.Eq a_ag6 =>
     GHC.Classes.Eq (ShouldFail.Bar a_ag6)
[LclIdX[DFunId],
 Arity=1,
 Str=DmdType Lm,
 Unf=DFun(arity=2) GHC.Classes.D:Eq [$c==_agv, $c/=_agz]]
ShouldFail.$fEqBar =
  \ (@ a_ag6) ($dEq_agt [Dmd=Just L] :: GHC.Classes.Eq a_ag6) ->
    GHC.Classes.D:Eq
      @ (ShouldFail.Bar a_ag6)
      ($c==_agv @ a_ag6 $dEq_agt)
      ($c/=_agz @ a_ag6 $dEq_agt)

$c$p1Ord_agG
  :: forall a_ag5.
     GHC.Classes.Ord a_ag5 =>
     GHC.Classes.Eq (ShouldFail.Bar a_ag5)
[LclId,
 Arity=1,
 Str=DmdType Lm,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=1, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
         Tmpl= \ (@ a_ag5)
                 ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5) ->
                 ShouldFail.$fEqBar @ a_ag5 (GHC.Classes.$p1Ord @ a_ag5 $dOrd_agD)}]
$c$p1Ord_agG =
  \ (@ a_ag5) ($dOrd_agD :: GHC.Classes.Ord a_ag5) ->
    ShouldFail.$fEqBar @ a_ag5 (GHC.Classes.$p1Ord @ a_ag5 $dOrd_agD)

eta_skd :: forall a_ag5. ShouldFail.Bar a_ag5
[LclId]
eta_skd =
  \ (@ a_ag5) ->
    Control.Exception.Base.absentError
      @ (ShouldFail.Bar a_ag5)
      "w_sk3{v} [lid] main:ShouldFail.Bar{tc r9Z} a{tv ag5} [tv]"

eta_skc :: forall a_ag5. ShouldFail.Bar a_ag5
[LclId]
eta_skc =
  \ (@ a_ag5) ->
    Control.Exception.Base.absentError
      @ (ShouldFail.Bar a_ag5)
      "w_sk2{v} [lid] main:ShouldFail.Bar{tc r9Z} a{tv ag5} [tv]"

$dOrd_skb :: forall a_ag5. GHC.Classes.Ord a_ag5
[LclId]
$dOrd_skb =
  \ (@ a_ag5) ->
    Control.Exception.Base.absentError
      @ (GHC.Classes.Ord a_ag5)
      "w_sk1{v} [lid] ghc-prim:GHC.Classes.Ord{tc 2c} a{tv ag5} [tv]"

lvl_skh :: forall a_ag5. GHC.Classes.Eq a_ag5
[LclId]
lvl_skh =
  \ (@ a_ag5) -> GHC.Classes.$p1Ord @ a_ag5 ($dOrd_skb @ a_ag5)

$w$ccompare_sk5 :: forall a_ag5. GHC.Types.Ordering
[LclId, Str=DmdType b]
$w$ccompare_sk5 =
  \ (@ a_ag5) ->
    case $c==_agv
           @ a_ag5 (lvl_skh @ a_ag5) (eta_skc @ a_ag5) (eta_skd @ a_ag5)
    of wild_00 {
    }

$ccompare_agI [InlPrag=INLINE[0]]
  :: forall a_ag5.
     GHC.Classes.Ord a_ag5 =>
     ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Ordering
[LclId,
 Arity=3,
 Str=DmdType AAAb,
 Unf=Unf{Src=Worker=$w$ccompare_sk5, TopLvl=True, Arity=3,
         Value=True, ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=True)
         Tmpl= \ (@ a_ag5) _ _ _ -> $w$ccompare_sk5 @ a_ag5}]
$ccompare_agI = \ (@ a_ag5) _ _ _ -> $w$ccompare_sk5 @ a_ag5

$c<=_ah4
  :: forall a_ag5.
     GHC.Classes.Ord a_ag5 =>
     ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool
[LclId,
 Arity=3,
 Str=DmdType AAAb,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
         Tmpl= \ (@ a_ag5)
                 ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)
                 (x_ahU [Occ=Once] :: ShouldFail.Bar a_ag5)
                 (y_ahV [Occ=Once] :: ShouldFail.Bar a_ag5) ->
                 case $ccompare_agI @ a_ag5 $dOrd_agD x_ahU y_ahV of _ { }}]
$c<=_ah4 = \ (@ a_ag5) _ _ _ -> case $w$ccompare_sk5 of wild_00 { }

$c<_agS
  :: forall a_ag5.
     GHC.Classes.Ord a_ag5 =>
     ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool
[LclId,
 Arity=3,
 Str=DmdType AAAb,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
         Tmpl= \ (@ a_ag5)
                 ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)
                 (x_aii [Occ=Once] :: ShouldFail.Bar a_ag5)
                 (y_aij [Occ=Once] :: ShouldFail.Bar a_ag5) ->
                 case $ccompare_agI @ a_ag5 $dOrd_agD x_aii y_aij of _ { }}]
$c<_agS = $c<=_ah4

$c>=_agW
  :: forall a_ag5.
     GHC.Classes.Ord a_ag5 =>
     ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool
[LclId,
 Arity=3,
 Str=DmdType AAAb,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
         Tmpl= \ (@ a_ag5)
                 ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)
                 (x_aia [Occ=Once] :: ShouldFail.Bar a_ag5)
                 (y_aib [Occ=Once] :: ShouldFail.Bar a_ag5) ->
                 case $ccompare_agI @ a_ag5 $dOrd_agD x_aia y_aib of _ { }}]
$c>=_agW = $c<=_ah4

$c>_ah0
  :: forall a_ag5.
     GHC.Classes.Ord a_ag5 =>
     ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool
[LclId,
 Arity=3,
 Str=DmdType AAAb,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
         Tmpl= \ (@ a_ag5)
                 ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)
                 (x_ai2 [Occ=Once] :: ShouldFail.Bar a_ag5)
                 (y_ai3 [Occ=Once] :: ShouldFail.Bar a_ag5) ->
                 case $ccompare_agI @ a_ag5 $dOrd_agD x_ai2 y_ai3 of _ { }}]
$c>_ah0 = $c<=_ah4

$cmax_ah8
  :: forall a_ag5.
     GHC.Classes.Ord a_ag5 =>
     ShouldFail.Bar a_ag5
     -> ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5
[LclId,
 Arity=3,
 Str=DmdType ASSb,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
         Tmpl= \ (@ a_ag5)
                 ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)
                 (x_ahK [Occ=Once] :: ShouldFail.Bar a_ag5)
                 (y_ahL [Occ=Once] :: ShouldFail.Bar a_ag5) ->
                 case $ccompare_agI @ a_ag5 $dOrd_agD x_ahK y_ahL of _ { }}]
$cmax_ah8 = $c<=_ah4

$cmin_ahc
  :: forall a_ag5.
     GHC.Classes.Ord a_ag5 =>
     ShouldFail.Bar a_ag5
     -> ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5
[LclId,
 Arity=3,
 Str=DmdType ASSb,
 Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,
         ConLike=True, WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
         Tmpl= \ (@ a_ag5)
                 ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)
                 (x_ahy [Occ=Once] :: ShouldFail.Bar a_ag5)
                 (y_ahz [Occ=Once] :: ShouldFail.Bar a_ag5) ->
                 case $ccompare_agI @ a_ag5 $dOrd_agD x_ahy y_ahz of _ { }}]
$cmin_ahc = $c<=_ah4

lvl_ski
  :: forall a_ag5.
     ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Ordering
[LclId, Arity=2, Str=DmdType TTb]
lvl_ski = \ (@ a_ag5) _ _ -> $w$ccompare_sk5 @ a_ag5

ShouldFail.$fOrdBar [InlPrag=[ALWAYS] CONLIKE]
  :: forall a_ag5.
     GHC.Classes.Ord a_ag5 =>
     GHC.Classes.Ord (ShouldFail.Bar a_ag5)
[LclIdX[DFunId],
 Arity=1,
 Str=DmdType Lm,
 Unf=DFun(arity=2) GHC.Classes.D:Ord [$c$p1Ord_agG, $ccompare_agI,
                                      $c<_agS, $c>=_agW, $c>_ah0, $c<=_ah4, $cmax_ah8, $cmin_ahc]]
ShouldFail.$fOrdBar =
  \ (@ a_ag5) ($dOrd_agD [Dmd=Just L] :: GHC.Classes.Ord a_ag5) ->
    GHC.Classes.D:Ord
      @ (ShouldFail.Bar a_ag5)
      ($c$p1Ord_agG @ a_ag5 $dOrd_agD)
      (lvl_ski @ a_ag5)
      ($c<_agS @ a_ag5 $dOrd_agD)
      ($c>=_agW @ a_ag5 $dOrd_agD)
      ($c>_ah0 @ a_ag5 $dOrd_agD)
      ($c<=_ah4 @ a_ag5 $dOrd_agD)
      ($cmax_ah8 @ a_ag5 $dOrd_agD)
      ($cmin_ahc @ a_ag5 $dOrd_agD)

*** End of Offense ***


<no location info>: 
Compilation had errors



*** unexpected failure for tc078(optasm)

Change History (5)

comment:1 Changed 3 years ago by igloo

  • Test Case set to tc078

comment:2 Changed 3 years ago by simonpj

Ahhh. I'm on it.

comment:3 Changed 3 years ago by igloo

  • Owner set to simonpj

comment:4 Changed 3 years ago by simonpj@…

commit ebcad7641a1e37e2e4abd7f513feb10c4ee458bc

Author: Simon Peyton Jones <[email protected]>
Date:   Wed May 16 10:50:36 2012 +0100

    When comparing Case expressions, take account of empty alternatives
    
    After the recent change that allows empty case alternatives, we
    were accidentally saying that these two were equal:
       Case x _ Int  []
       Case x _ Bool []
    Usually if the alternatives are equal so is the result type -- but
    not if the alternatives are empty!
    
    There are two places to fix:
      CoreUtils.eqExpr
      TrieMap with CoreExpr key
    
    Fixes #6096, #6097

 compiler/coreSyn/CoreUtils.lhs |    9 +++--
 compiler/coreSyn/TrieMap.lhs   |   60 ++++++++++++++++++++++++++-------------
 2 files changed, 45 insertions(+), 24 deletions(-)

comment:5 Changed 3 years ago by simonpj

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