[GHC] #12650: Too many warnigns about consistentCafInfo

#12650: Too many warnigns about consistentCafInfo -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Building GHC with debug on yiedls in many (97!) warnings of the form {{{ WARNING: file compiler/stgSyn/CoreToStg.hs, line 252 $fFunctorIOEnv True False }}} The code in question is {{{ -- Assertion helper: this checks that the CafInfo on the Id matches -- what CoreToStg has figured out about the binding's SRT. The -- CafInfo will be exact in all cases except when CorePrep has -- floated out a binding, in which case it will be approximate. consistentCafInfo :: Id -> GenStgBinding Var Id -> Bool consistentCafInfo id bind = WARN( not (exact || is_sat_thing) , ppr id <+> ppr id_marked_caffy <+> ppr binding_is_caffy ) safe where safe = id_marked_caffy || not binding_is_caffy exact = id_marked_caffy == binding_is_caffy id_marked_caffy = mayHaveCafRefs (idCafInfo id) binding_is_caffy = topStgBindHasCafRefs bind is_sat_thing = occNameFS (nameOccName (idName id)) == fsLit "sat" }}} It would be nice to have less warnings, to make them more useful. I don’t know if the warning is not right, or if there is something that can be fixed about the thing it is warning about. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12650 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12650: Too many warnigns about consistentCafInfo -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I agree. Potentially this a serious warning. Someone should look into it! It happens if * The info about CAF-hood predicted by `CorePrep` differ from... * the info about CAF-hood discovered by `CoreToStg` I can advise. As a systematic fix, I really want to get info about arity and CAF-hood from the `CoreToStg` pass, and NOT predict it in `CorePrep`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12650#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12650: Too many warnigns about consistentCafInfo -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * cc: mpickering (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12650#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12650: Too many warnigns about consistentCafInfo -------------------------------------+------------------------------------- Reporter: nomeata | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): I looked at this a little bit this morning but I don't understand this part of the compiler well enough. Looking at the assertion code, it seems that `binding_is_caffy` is the truth about the binding and we are checking that it agrees with what we predicted earlier. 1. Why is this property checked at all? 2. Why it is predicted in CorePrep rather than discovered in CoreToStg? 3. How involved would it be to implement the suggestion in comment:1? I also observed this with a dictionary like Joachim did in the original example so perhaps there is something slightly wrong with the analysis of dictionaries. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12650#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12650: Too many warnings about consistentCafInfo -------------------------------------+------------------------------------- Reporter: nomeata | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by mpickering: Old description:
Building GHC with debug on yiedls in many (97!) warnings of the form {{{ WARNING: file compiler/stgSyn/CoreToStg.hs, line 252 $fFunctorIOEnv True False }}}
The code in question is {{{ -- Assertion helper: this checks that the CafInfo on the Id matches -- what CoreToStg has figured out about the binding's SRT. The -- CafInfo will be exact in all cases except when CorePrep has -- floated out a binding, in which case it will be approximate. consistentCafInfo :: Id -> GenStgBinding Var Id -> Bool consistentCafInfo id bind = WARN( not (exact || is_sat_thing) , ppr id <+> ppr id_marked_caffy <+> ppr binding_is_caffy ) safe where safe = id_marked_caffy || not binding_is_caffy exact = id_marked_caffy == binding_is_caffy id_marked_caffy = mayHaveCafRefs (idCafInfo id) binding_is_caffy = topStgBindHasCafRefs bind is_sat_thing = occNameFS (nameOccName (idName id)) == fsLit "sat" }}}
It would be nice to have less warnings, to make them more useful. I don’t know if the warning is not right, or if there is something that can be fixed about the thing it is warning about.
New description: Building GHC with debug on yields in many (97!) warnings of the form {{{ WARNING: file compiler/stgSyn/CoreToStg.hs, line 252 $fFunctorIOEnv True False }}} The code in question is {{{ -- Assertion helper: this checks that the CafInfo on the Id matches -- what CoreToStg has figured out about the binding's SRT. The -- CafInfo will be exact in all cases except when CorePrep has -- floated out a binding, in which case it will be approximate. consistentCafInfo :: Id -> GenStgBinding Var Id -> Bool consistentCafInfo id bind = WARN( not (exact || is_sat_thing) , ppr id <+> ppr id_marked_caffy <+> ppr binding_is_caffy ) safe where safe = id_marked_caffy || not binding_is_caffy exact = id_marked_caffy == binding_is_caffy id_marked_caffy = mayHaveCafRefs (idCafInfo id) binding_is_caffy = topStgBindHasCafRefs bind is_sat_thing = occNameFS (nameOccName (idName id)) == fsLit "sat" }}} It would be nice to have less warnings, to make them more useful. I don’t know if the warning is not right, or if there is something that can be fixed about the thing it is warning about. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12650#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12650: Too many warnings about consistentCafInfo -------------------------------------+------------------------------------- Reporter: nomeata | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): See #9718, which answers (2). For (1) we check because if the predication is incorrect (e.g. says that it has no CAF refs when actually it does) we could fail to keep stuff alive during GC that was alive, with resulting seg-faults. Re (3), not too hard! And very valuable. See #9718. I'm keen to get this done. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12650#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC