GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:43:45Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/8729Compile crashed with panic! (the 'impossible' happened)2019-07-07T18:43:45ZzabiraufCompile crashed with panic! (the 'impossible' happened)The following code results in a compiler crash with error
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-unknown-linux):
nameModule show{tv a9N}
Please report this as a GHC bug: http://www.haskell.org/ghc...The following code results in a compiler crash with error
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for x86_64-unknown-linux):
nameModule show{tv a9N}
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
The code can be found at [http://pastie.org/8692515](http://pastie.org/8692515)7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/7185Compiled program crashes2019-07-07T18:50:57ZwaldheinzCompiled program crashesI have a program which compiles fine, but the resulting executable crashes. First the steps to reproduce:
```
git clone git@github.com:waldheinz/bling.git
git checkout e2bad3ca6be2409386d28796997709318cf6ff64
cabal configure
cabal build...I have a program which compiles fine, but the resulting executable crashes. First the steps to reproduce:
```
git clone git@github.com:waldheinz/bling.git
git checkout e2bad3ca6be2409386d28796997709318cf6ff64
cabal configure
cabal build
./dist/build/bling/bling examples/cornell-box-underwater.bling
```
This will result in either a segfault or produce an "internal error" message, at least for me and two other who tried it as well. The error message is
```
bling: internal error: scavenge_one: strange object -1083673327
(GHC version 7.7.20120823 for x86_64_unknown_linux)
```
The "strange object" varies. Some random observations which might be useful:
- this happens with GHC 7.4.1 and a fresh compile of HEAD (GHC version 7.7.20120823)
- I sanitized the code to be completely free of unsafe\* function calls. Before, there was quite some unsafe array reading/writing using the vector package. This did not change anything, but the revision above reflects this "safe" state, just in case...
- the problem first occured when I change the SPPM.mkHash function to use the Utils.GrowVec type instead of lists for it's intermediate results. \[1\] GrowVec is basically a wrapper around a vector which doubles the size when space is exhausted.
- the optimization level does not seem to affect the problem (it occurs even with -O0 and everything else removed)
Running under GDB gives this stack trace:
```
#1 0x00000031d12370d8 in abort () from /lib64/libc.so.6
#2 0x0000000000cb4765 in rtsFatalInternalErrorFn ()
#3 0x0000000000cb48dd in barf ()
#4 0x0000000000cd30e9 in scavenge_one ()
#5 0x0000000000cd3645 in scavenge_mutable_list ()
#6 0x0000000000cd3835 in scavenge_capability_mut_lists ()
#7 0x0000000000cb98bc in GarbageCollect ()
#8 0x0000000000cac043 in scheduleDoGC.isra.20 ()
#9 0x0000000000cacabf in scheduleWaitThread ()
#10 0x0000000000cb683e in real_main ()
#11 0x0000000000cb693a in hs_main ()
#12 0x0000000000407003 in main ()
```
I'm currently trying to debug this further, but my abilities on this front are limited...
\[1\] https://github.com/waldheinz/bling/commit/e1dc7b3c7e66cdd21a5aa46f9f96ca9448c52407\#commitcomment-1761893
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Compiled program crashes","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I have a program which compiles fine, but the resulting executable crashes. First the steps to reproduce:\r\n\r\n{{{\r\ngit clone git@github.com:waldheinz/bling.git\r\ngit checkout e2bad3ca6be2409386d28796997709318cf6ff64\r\ncabal configure\r\ncabal build\r\n./dist/build/bling/bling examples/cornell-box-underwater.bling\r\n}}}\r\n\r\nThis will result in either a segfault or produce an \"internal error\" message, at least for me and two other who tried it as well. The error message is\r\n\r\n{{{\r\nbling: internal error: scavenge_one: strange object -1083673327\r\n (GHC version 7.7.20120823 for x86_64_unknown_linux)\r\n}}}\r\n\r\nThe \"strange object\" varies. Some random observations which might be useful:\r\n\r\n * this happens with GHC 7.4.1 and a fresh compile of HEAD (GHC version 7.7.20120823)\r\n * I sanitized the code to be completely free of unsafe* function calls. Before, there was quite some unsafe array reading/writing using the vector package. This did not change anything, but the revision above reflects this \"safe\" state, just in case...\r\n * the problem first occured when I change the SPPM.mkHash function to use the Utils.GrowVec type instead of lists for it's intermediate results. [1] GrowVec is basically a wrapper around a vector which doubles the size when space is exhausted. \r\n * the optimization level does not seem to affect the problem (it occurs even with -O0 and everything else removed)\r\n\r\nRunning under GDB gives this stack trace: \r\n\r\n{{{\r\n#1 0x00000031d12370d8 in abort () from /lib64/libc.so.6\r\n#2 0x0000000000cb4765 in rtsFatalInternalErrorFn ()\r\n#3 0x0000000000cb48dd in barf ()\r\n#4 0x0000000000cd30e9 in scavenge_one ()\r\n#5 0x0000000000cd3645 in scavenge_mutable_list ()\r\n#6 0x0000000000cd3835 in scavenge_capability_mut_lists ()\r\n#7 0x0000000000cb98bc in GarbageCollect ()\r\n#8 0x0000000000cac043 in scheduleDoGC.isra.20 ()\r\n#9 0x0000000000cacabf in scheduleWaitThread ()\r\n#10 0x0000000000cb683e in real_main ()\r\n#11 0x0000000000cb693a in hs_main ()\r\n#12 0x0000000000407003 in main ()\r\n}}}\r\n\r\nI'm currently trying to debug this further, but my abilities on this front are limited...\r\n\r\n[1] https://github.com/waldheinz/bling/commit/e1dc7b3c7e66cdd21a5aa46f9f96ca9448c52407#commitcomment-1761893","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/7170Foreign.Concurrent finalizer called twice in some cases2019-07-07T18:51:01ZjoeyadamsForeign.Concurrent finalizer called twice in some casesWhen [Foreign.Concurrent.newForeignPtr](http://hackage.haskell.org/packages/archive/base/latest/doc/html/Foreign-Concurrent.html#v:newForeignPtr) is used, here's a case where the finalizer is called twice:
```
{-# LANGUAGE ForeignFuncti...When [Foreign.Concurrent.newForeignPtr](http://hackage.haskell.org/packages/archive/base/latest/doc/html/Foreign-Concurrent.html#v:newForeignPtr) is used, here's a case where the finalizer is called twice:
```
{-# LANGUAGE ForeignFunctionInterface #-}
import Control.Concurrent
import Control.Exception (bracket)
import Foreign.Ptr (Ptr, intPtrToPtr)
import Foreign.ForeignPtr (ForeignPtr)
import qualified Foreign.Concurrent as FC
import qualified Foreign.ForeignPtr as FP
testForeignPtr_Concurrent :: Ptr a -> IO (ForeignPtr a)
testForeignPtr_Concurrent ptr = FC.newForeignPtr ptr (fin ptr)
fin :: Ptr a -> IO ()
fin ptr = putStrLn $ "finalizing " ++ show ptr
main :: IO ()
main = do
mv <- newEmptyMVar
bracket (testForeignPtr_Concurrent $ intPtrToPtr 1)
FP.finalizeForeignPtr $ \_ ->
-- hang, so the thread and foreign pointer get GCed
takeMVar mv
```
This produces the following output:
```
finalizing 0x0000000000000001
finalizing 0x0000000000000001
foreignptr: thread blocked indefinitely in an MVar operation
```
This happens on GHC 7.4.2 and 7.6.0.20120810, with and without -threaded.
This can easily lead to segfaults when you have an FFI library that does this:
```
create :: IO Object
create = do
ptr <- c_create
CObject <$> newForeignPtr ptr (finalize ptr)
finalize :: Ptr CObject -> IO ()
finalize ptr = do
...
destroy :: Object -> IO ()
destroy (Object fptr) =
finalizeForeignPtr fptr
```
And application code does this:
```
bracket create destroy $ \obj -> do
...
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.4.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Foreign.Concurrent finalizer called twice in some cases","status":"New","operating_system":"","component":"Runtime System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"When [http://hackage.haskell.org/packages/archive/base/latest/doc/html/Foreign-Concurrent.html#v:newForeignPtr Foreign.Concurrent.newForeignPtr] is used, here's a case where the finalizer is called twice:\r\n\r\n{{{\r\n{-# LANGUAGE ForeignFunctionInterface #-}\r\nimport Control.Concurrent\r\nimport Control.Exception (bracket)\r\nimport Foreign.Ptr (Ptr, intPtrToPtr)\r\nimport Foreign.ForeignPtr (ForeignPtr)\r\nimport qualified Foreign.Concurrent as FC\r\nimport qualified Foreign.ForeignPtr as FP\r\n\r\ntestForeignPtr_Concurrent :: Ptr a -> IO (ForeignPtr a)\r\ntestForeignPtr_Concurrent ptr = FC.newForeignPtr ptr (fin ptr)\r\n\r\nfin :: Ptr a -> IO ()\r\nfin ptr = putStrLn $ \"finalizing \" ++ show ptr\r\n\r\nmain :: IO ()\r\nmain = do\r\n mv <- newEmptyMVar\r\n bracket (testForeignPtr_Concurrent $ intPtrToPtr 1)\r\n FP.finalizeForeignPtr $ \\_ ->\r\n -- hang, so the thread and foreign pointer get GCed\r\n takeMVar mv\r\n}}}\r\n\r\nThis produces the following output:\r\n\r\n{{{\r\nfinalizing 0x0000000000000001\r\nfinalizing 0x0000000000000001\r\nforeignptr: thread blocked indefinitely in an MVar operation\r\n}}}\r\n\r\nThis happens on GHC 7.4.2 and 7.6.0.20120810, with and without -threaded.\r\n\r\nThis can easily lead to segfaults when you have an FFI library that does this:\r\n\r\n{{{\r\ncreate :: IO Object\r\ncreate = do\r\n ptr <- c_create\r\n CObject <$> newForeignPtr ptr (finalize ptr)\r\n\r\nfinalize :: Ptr CObject -> IO ()\r\nfinalize ptr = do\r\n ...\r\n\r\ndestroy :: Object -> IO ()\r\ndestroy (Object fptr) =\r\n finalizeForeignPtr fptr\r\n}}}\r\n\r\nAnd application code does this:\r\n\r\n{{{\r\nbracket create destroy $ \\obj -> do\r\n ...\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1niterianiteriahttps://gitlab.haskell.org/ghc/ghc/-/issues/7160C finalizers are reversed during GC2019-07-07T18:51:04ZBertram FelgenhauerC finalizers are reversed during GC(See also thread starting at http://www.haskell.org/pipermail/libraries/2012-August/018302.html )
The list of finalizers is reversed during GC (cf. `rts/sm/MarkWeak.c`), which may cause them to run in the wrong order.
The following prog...(See also thread starting at http://www.haskell.org/pipermail/libraries/2012-August/018302.html )
The list of finalizers is reversed during GC (cf. `rts/sm/MarkWeak.c`), which may cause them to run in the wrong order.
The following program reproduces this behaviour.
```
{-# LANGUAGE ForeignFunctionInterface, MagicHash #-}
import GHC.ForeignPtr
import GHC.Ptr
import System.Mem
-- one should really use own C function rather than this varargs one to avoid
-- possible ABI issues
foreign import ccall "&debugBelch" fun :: FunPtr (Ptr () -> Ptr () -> IO ())
new name = do
p <- newForeignPtr_ (Ptr name)
addForeignPtrFinalizerEnv fun (Ptr "finalizer 1 (%s)\n"#) p
addForeignPtrFinalizerEnv fun (Ptr "finalizer 2 (%s)\n"#) p
return p
main = do
p <- new "p"#
q <- new "q"#
r <- new "r"#
performGC -- collect p. finalizer order: 2, then 1.
print q
performGC -- collect q. finalizer order: 1, then 2.
-- expected order: 2, then 1.
print r
performGC -- collect r. finalizer order: 2, then 1.
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.6.1-rc1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"C finalizers are reversed during GC","status":"New","operating_system":"","component":"Runtime System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.6.1-rc1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"(See also thread starting at http://www.haskell.org/pipermail/libraries/2012-August/018302.html )\r\n\r\nThe list of finalizers is reversed during GC (cf. {{{rts/sm/MarkWeak.c}}}), which may cause them to run in the wrong order.\r\nThe following program reproduces this behaviour.\r\n\r\n{{{\r\n{-# LANGUAGE ForeignFunctionInterface, MagicHash #-}\r\nimport GHC.ForeignPtr\r\nimport GHC.Ptr\r\nimport System.Mem\r\n\r\n-- one should really use own C function rather than this varargs one to avoid\r\n-- possible ABI issues\r\nforeign import ccall \"&debugBelch\" fun :: FunPtr (Ptr () -> Ptr () -> IO ())\r\n\r\nnew name = do\r\n p <- newForeignPtr_ (Ptr name)\r\n addForeignPtrFinalizerEnv fun (Ptr \"finalizer 1 (%s)\\n\"#) p\r\n addForeignPtrFinalizerEnv fun (Ptr \"finalizer 2 (%s)\\n\"#) p\r\n return p\r\n\r\nmain = do\r\n p <- new \"p\"#\r\n q <- new \"q\"#\r\n r <- new \"r\"#\r\n performGC -- collect p. finalizer order: 2, then 1.\r\n print q\r\n performGC -- collect q. finalizer order: 1, then 2.\r\n -- expected order: 2, then 1.\r\n print r\r\n performGC -- collect r. finalizer order: 2, then 1.\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/7127RTS timer gets turned off when using +RTS -I02019-07-07T18:51:15ZSimon MarlowRTS timer gets turned off when using +RTS -I0This bug was reported to me by `hvr` on IRC. I fixed it in GHC yesterday, but we still need a test, and we could potentially merge this to the 7.4 and 7.6 branches:
commit 396f09031b363bf2f0d2afa28a86e67a0628a696
```
Author: Simon Marl...This bug was reported to me by `hvr` on IRC. I fixed it in GHC yesterday, but we still need a test, and we could potentially merge this to the 7.4 and 7.6 branches:
commit 396f09031b363bf2f0d2afa28a86e67a0628a696
```
Author: Simon Marlow <marlowsd@gmail.com>
Date: Tue Aug 7 14:44:46 2012 +0100
Fix a bug in the handling of recent_activity
The problem occurred when the idle GC was turned off with +RTS -I0.
Then the scheduler would go into the state ACTIVITY_DONE_GC directly
without doing a GC, and a subsequent GC would put it back to
ACTIVITY_YES but without turning the timer back on. Instead if the GC
finds the state is ACTIVITY_DONE_GC it should leave it there.
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.4.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"RTS timer gets turned off when using +RTS -I0","status":"New","operating_system":"","component":"Runtime System","related":[],"milestone":"7.6.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"simonmar"},"version":"7.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This bug was reported to me by `hvr` on IRC. I fixed it in GHC yesterday, but we still need a test, and we could potentially merge this to the 7.4 and 7.6 branches:\r\n\r\ncommit 396f09031b363bf2f0d2afa28a86e67a0628a696\r\n{{{\r\nAuthor: Simon Marlow <marlowsd@gmail.com>\r\nDate: Tue Aug 7 14:44:46 2012 +0100\r\n\r\n Fix a bug in the handling of recent_activity\r\n \r\n The problem occurred when the idle GC was turned off with +RTS -I0.\r\n Then the scheduler would go into the state ACTIVITY_DONE_GC directly\r\n without doing a GC, and a subsequent GC would put it back to\r\n ACTIVITY_YES but without turning the timer back on. Instead if the GC\r\n finds the state is ACTIVITY_DONE_GC it should leave it there.\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/7113linux-powerpc : large integer implicitly truncated to unsigned type2019-07-07T18:51:19Zerikdlinux-powerpc : large integer implicitly truncated to unsigned typeCompiling on linux-powerpc using gcc 4.6.3 and get:
```
rts_dist_HC rts/dist/build/posix/Select.o
rts/posix/Select.c: In function 'getDelayTarget':
rts/posix/Select.c:76:9:
error: large integer implicitly truncated to unsigned t...Compiling on linux-powerpc using gcc 4.6.3 and get:
```
rts_dist_HC rts/dist/build/posix/Select.o
rts/posix/Select.c: In function 'getDelayTarget':
rts/posix/Select.c:76:9:
error: large integer implicitly truncated to unsigned type [-Werror=overflow]
cc1: all warnings being treated as errors
make[1]: *** [rts/dist/build/posix/Select.o] Error 1
```
In the process of validating a patch.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | powerpc |
</details>
<!-- {"blocked_by":[],"summary":"linux-powerpc : large integer implicitly truncated to unsigned type","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"powerpc","cc":[""],"type":"Bug","description":"Compiling on linux-powerpc using gcc 4.6.3 and get:\r\n\r\n{{{\r\n rts_dist_HC rts/dist/build/posix/Select.o\r\nrts/posix/Select.c: In function 'getDelayTarget':\r\n\r\nrts/posix/Select.c:76:9:\r\n error: large integer implicitly truncated to unsigned type [-Werror=overflow]\r\ncc1: all warnings being treated as errors\r\nmake[1]: *** [rts/dist/build/posix/Select.o] Error 1\r\n}}}\r\n\r\nIn the process of validating a patch.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/7086haddock memory usage regression2019-07-07T18:51:25ZIan Lynagh <igloo@earth.li>haddock memory usage regressionHaddock uses a lot more memory than it used to.
Attached are `haddock-before.png`, showing memory usage of 4dc9ecd3905f75adb6bcfb818fbc163c724d4545, and `haddock-after.png`, showing memory usage of 7f164839d8b0b6e53fa0f15d2a6810ca310e33...Haddock uses a lot more memory than it used to.
Attached are `haddock-before.png`, showing memory usage of 4dc9ecd3905f75adb6bcfb818fbc163c724d4545, and `haddock-after.png`, showing memory usage of 7f164839d8b0b6e53fa0f15d2a6810ca310e337d, while haddocking the ghc package.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | None |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"haddock memory usage regression","status":"New","operating_system":"","component":"None","related":[],"milestone":"7.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Haddock uses a lot more memory than it used to.\r\n\r\nAttached are `haddock-before.png`, showing memory usage of 4dc9ecd3905f75adb6bcfb818fbc163c724d4545, and `haddock-after.png`, showing memory usage of 7f164839d8b0b6e53fa0f15d2a6810ca310e337d, while haddocking the ghc package.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>https://gitlab.haskell.org/ghc/ghc/-/issues/7061Allow 'default' declarations within GHCi2019-07-07T18:51:35ZparcsAllow 'default' declarations within GHCiGHCi currently doesn't support 'default' declarations, and #4929 somehow missed it (or perhaps it was intentionally not implemented?)
Nonetheless, the addition turned out to be seemingly straightforward. Patch attached.
<details><summa...GHCi currently doesn't support 'default' declarations, and #4929 somehow missed it (or perhaps it was intentionally not implemented?)
Nonetheless, the addition turned out to be seemingly straightforward. Patch attached.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.4.2 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Allow 'default' declarations within GHCi","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"GHCi currently doesn't support 'default' declarations, and #4929 somehow missed it (or perhaps it was intentionally not implemented?)\r\n\r\nNonetheless, the addition turned out to be seemingly straightforward. Patch attached.","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/7060Option -ddump-rule-rewrites doesn't dump to a file2019-07-07T18:51:35ZerikdOption -ddump-rule-rewrites doesn't dump to a fileRunning the command (using my GHC git HEAD compiler):
```
~/GHC/bin/ghc -v --make -dumpdir dumpopt/ -ddump-to-file -ddump-rule-rewrites -O1 --make mask-test.hs -o mask-test-opt
```
and the `-ddump-rule-rewrites` output still ends up on...Running the command (using my GHC git HEAD compiler):
```
~/GHC/bin/ghc -v --make -dumpdir dumpopt/ -ddump-to-file -ddump-rule-rewrites -O1 --make mask-test.hs -o mask-test-opt
```
and the `-ddump-rule-rewrites` output still ends up on the console instead of the specified dumpdir.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Option -ddump-rule-rewrites doesn't dump to a file","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Running the command (using my GHC git HEAD compiler):\r\n\r\n{{{\r\n~/GHC/bin/ghc -v --make -dumpdir dumpopt/ -ddump-to-file -ddump-rule-rewrites -O1 --make mask-test.hs -o mask-test-opt\r\n}}}\r\n\r\nand the `-ddump-rule-rewrites` output still ends up on the console instead of the specified dumpdir.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1pcapriottipcapriottihttps://gitlab.haskell.org/ghc/ghc/-/issues/7058Add strict version of modifySTRef2019-07-07T18:51:35ZjoeyadamsAdd strict version of modifySTRefWe added strict versions of modifyIORef and atomicModifyIORef recently (see #5926), and STM has [modifyTVar'](http://hackage.haskell.org/packages/archive/stm/latest/doc/html/Control-Concurrent-STM-TVar.html#v:modifyTVar-39-) since stm-2....We added strict versions of modifyIORef and atomicModifyIORef recently (see #5926), and STM has [modifyTVar'](http://hackage.haskell.org/packages/archive/stm/latest/doc/html/Control-Concurrent-STM-TVar.html#v:modifyTVar-39-) since stm-2.3.
This patch adds `modifySTRef'`, mostly copy-pasted from `modifyIORef'`. My ghc currently doesn't build, so I wasn't able to test it.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.4.2 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Add strict version of modifySTRef","status":"New","operating_system":"","component":"libraries/base","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"We added strict versions of modifyIORef and atomicModifyIORef recently (see #5926), and STM has [http://hackage.haskell.org/packages/archive/stm/latest/doc/html/Control-Concurrent-STM-TVar.html#v:modifyTVar-39- modifyTVar'] since stm-2.3.\r\n\r\nThis patch adds {{{modifySTRef'}}}, mostly copy-pasted from {{{modifyIORef'}}}. My ghc currently doesn't build, so I wasn't able to test it.","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/7041GHC.Real.gcdInt is no longer optimized.2019-07-07T18:51:39ZBertram FelgenhauerGHC.Real.gcdInt is no longer optimized.This is a regression since ghc-7.2, related to #5767. `GHC.Real` defines
```
gcdInt :: Int -> Int -> Int
gcdInt a b = fromIntegral (gcdInteger (fromIntegral a) (fromIntegral b))
```
which used to optimize to `GHC.Integer.Type.gcdInt`. ...This is a regression since ghc-7.2, related to #5767. `GHC.Real` defines
```
gcdInt :: Int -> Int -> Int
gcdInt a b = fromIntegral (gcdInteger (fromIntegral a) (fromIntegral b))
```
which used to optimize to `GHC.Integer.Type.gcdInt`. But since `fromInteger = integerToInt` and `fromIntegral = smallInteger` are no longer inlined, this optimization is lost. This results in unecessary allocations.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC.Real.gcdInt is no longer optimized.","status":"New","operating_system":"","component":"libraries/base","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This is a regression since ghc-7.2, related to #5767. {{{GHC.Real}}} defines\r\n\r\n{{{\r\ngcdInt :: Int -> Int -> Int\r\ngcdInt a b = fromIntegral (gcdInteger (fromIntegral a) (fromIntegral b))\r\n}}}\r\n\r\nwhich used to optimize to {{{GHC.Integer.Type.gcdInt}}}. But since {{{fromInteger = integerToInt}}} and {{{fromIntegral = smallInteger}}} are no longer inlined, this optimization is lost. This results in unecessary allocations.","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>https://gitlab.haskell.org/ghc/ghc/-/issues/7037setProgName() crashes when argv[0] == NULL2019-07-07T18:51:40ZshachafsetProgName() crashes when argv[0] == NULLC89 allows `argc` to be 0, in which case `argv[0]` is `NULL`. This can happen in practice in Linux+glibc with `execve(program, {NULL}, ...);`.
The RTS assumes that `argv[0]` always points to a valid string: `void setProgName(char *argv[...C89 allows `argc` to be 0, in which case `argv[0]` is `NULL`. This can happen in practice in Linux+glibc with `execve(program, {NULL}, ...);`.
The RTS assumes that `argv[0]` always points to a valid string: `void setProgName(char *argv[]) { char *last_slash; if ( (last_slash = (char *) strrchr(argv[0], '/')) != NULL ) { ... } else { ... } `}.
This means that any GHC-compiled program can be made to segfault with `execl("./ghc-compiled-program", NULL);`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.4.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"setProgName() crashes when argv[0] == NULL","status":"New","operating_system":"","component":"Runtime System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"C89 allows {{{argc}}} to be 0, in which case {{{argv[0]}}} is {{{NULL}}}. This can happen in practice in Linux+glibc with {{{execve(program, {NULL}, ...);}}}.\r\n\r\nThe RTS assumes that {{{argv[0]}}} always points to a valid string: {{{void setProgName(char *argv[]) { char *last_slash; if ( (last_slash = (char *) strrchr(argv[0], '/')) != NULL ) { ... } else { ... } }}}}.\r\n\r\nThis means that any GHC-compiled program can be made to segfault with {{{execl(\"./ghc-compiled-program\", NULL);}}}.","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/6156Optimiser bug on linux-powerpc2019-07-07T18:51:54ZerikdOptimiser bug on linux-powerpcFound a small chunk of code in the cryptocipher package that when compiled and run, produces a difference result when optimised compared to compiling un-optimised.
Note this is only a problem with PowerPC. On x86-64 there is no differen...Found a small chunk of code in the cryptocipher package that when compiled and run, produces a difference result when optimised compared to compiling un-optimised.
Note this is only a problem with PowerPC. On x86-64 there is no difference in the output between the optimised version and the un-optimised version.
I have two simple files (Camellia.hs):
```
module Camellia where
import Data.Bits
import Data.Word
import Debug.Trace
fl :: Word64 -> Word64 -> Word64
fl fin sk =
let (x1, x2) = w64tow32 fin in
let (k1, k2) = w64tow32 sk in
let y2 = x2 `xor` ((x1 .&. k1) `rotateL` 1) in
let y1 = x1 `xor` (y2 .|. k2) in
trace (show fin ++ " " ++ show sk ++ " -> " ++ show (w32tow64 (y1, y2))) $ w32tow64 (y1, y2)
w64tow32 :: Word64 -> (Word32, Word32)
w64tow32 w = (fromIntegral (w `shiftR` 32), fromIntegral (w .&. 0xffffffff))
w32tow64 :: (Word32, Word32) -> Word64
w32tow64 (x1, x2) = ((fromIntegral x1) `shiftL` 32) .|. (fromIntegral x2)
```
and a main program (camellia-test.hs):
```
import Data.Word
import qualified Camellia as Camellia
a, b :: Word64
a = 1238988323332265734
b = 11185553392205053542
main :: IO ()
main =
putStrLn $ "Camellia.fl " ++ show a ++ " " ++ show b ++ " -> " ++ show (Camellia.fl a b)
```
I'm also using this Makefile:
```
TARGETS = camilla-test-std camilla-test-opt
check : $(TARGETS)
./camilla-test-std
./camilla-test-opt
clean :
make clean-temp-files
rm -f $(TARGETS)
clean-temp-files :
rm -f camilla-test.o camilla-test.hi Camellia.o Camellia.hi
camilla-test-opt : camilla-test.hs Camellia.hs
ghc -Wall -O2 --make -i:Tests $< -o $@
make clean-temp-files
camilla-test-std : camilla-test.hs Camellia.hs
ghc -Wall --make -i:Tests $< -o $@
make clean-temp-files
```
When I run the two programs I get:
```
./camilla-test-std
1238988323332265734 11185553392205053542 -> 18360184157246690566
Camellia.fl 1238988323332265734 11185553392205053542 -> 18360184157246690566
./camilla-test-opt
1238988323332265734 11185553392205053542 -> 3698434091925017862
Camellia.fl 38662 15974 -> 3698434091925017862
```
So there are two problems here:
a) Showing Word64 values is not working correctly in the optimised version.
b) The function Camelia.fl produces the wrong result in the optimised version.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Optimiser bug on linux-powerpc","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Found a small chunk of code in the cryptocipher package that when compiled and run, produces a difference result when optimised compared to compiling un-optimised.\r\n\r\nNote this is only a problem with PowerPC. On x86-64 there is no difference in the output between the optimised version and the un-optimised version.\r\n\r\nI have two simple files (Camellia.hs):\r\n\r\n{{{\r\nmodule Camellia where\r\n\r\nimport Data.Bits\r\nimport Data.Word\r\n\r\nimport Debug.Trace\r\n\r\nfl :: Word64 -> Word64 -> Word64\r\nfl fin sk =\r\n\tlet (x1, x2) = w64tow32 fin in\r\n\tlet (k1, k2) = w64tow32 sk in\r\n\tlet y2 = x2 `xor` ((x1 .&. k1) `rotateL` 1) in\r\n\tlet y1 = x1 `xor` (y2 .|. k2) in\r\n\ttrace (show fin ++ \" \" ++ show sk ++ \" -> \" ++ show (w32tow64 (y1, y2))) $ w32tow64 (y1, y2)\r\n\r\nw64tow32 :: Word64 -> (Word32, Word32)\r\nw64tow32 w = (fromIntegral (w `shiftR` 32), fromIntegral (w .&. 0xffffffff))\r\n\r\nw32tow64 :: (Word32, Word32) -> Word64\r\nw32tow64 (x1, x2) = ((fromIntegral x1) `shiftL` 32) .|. (fromIntegral x2)\r\n}}}\r\n\r\nand a main program (camellia-test.hs):\r\n\r\n{{{\r\n\r\nimport Data.Word\r\nimport qualified Camellia as Camellia\r\n\r\na, b :: Word64\r\na = 1238988323332265734\r\nb = 11185553392205053542\r\n\r\nmain :: IO ()\r\nmain =\r\n putStrLn $ \"Camellia.fl \" ++ show a ++ \" \" ++ show b ++ \" -> \" ++ show (Camellia.fl a b)\r\n\r\n}}}\r\n\r\nI'm also using this Makefile:\r\n\r\n{{{\r\nTARGETS = camilla-test-std camilla-test-opt\r\n\r\ncheck : $(TARGETS)\r\n\t./camilla-test-std\r\n\t./camilla-test-opt\r\n\r\nclean :\r\n\tmake clean-temp-files\r\n\trm -f $(TARGETS)\r\n\r\nclean-temp-files :\r\n\trm -f camilla-test.o camilla-test.hi Camellia.o Camellia.hi\r\n\r\ncamilla-test-opt : camilla-test.hs Camellia.hs\r\n\tghc -Wall -O2 --make -i:Tests $< -o $@\r\n\tmake clean-temp-files\r\n\r\ncamilla-test-std : camilla-test.hs Camellia.hs\r\n\tghc -Wall --make -i:Tests $< -o $@\r\n\tmake clean-temp-files\r\n}}}\r\n\r\nWhen I run the two programs I get:\r\n\r\n{{{\r\n./camilla-test-std\r\n1238988323332265734 11185553392205053542 -> 18360184157246690566\r\nCamellia.fl 1238988323332265734 11185553392205053542 -> 18360184157246690566\r\n./camilla-test-opt\r\n1238988323332265734 11185553392205053542 -> 3698434091925017862\r\nCamellia.fl 38662 15974 -> 3698434091925017862\r\n}}}\r\n\r\nSo there are two problems here:\r\n\r\na) Showing Word64 values is not working correctly in the optimised version.\r\n\r\nb) The function Camelia.fl produces the wrong result in the optimised version.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/6121Very poor constant folding2019-07-07T18:52:05Zlennart@augustsson.netVery poor constant foldingGHC seems to lack constant folding for encodeFloat/decodeFloat.
For many examples, compile the numeric-limits package on hackage, or just this snippet:
```
epsilon :: Double
epsilon = r
where r = 1 - encodeFloat (m-1) e
(m, e)...GHC seems to lack constant folding for encodeFloat/decodeFloat.
For many examples, compile the numeric-limits package on hackage, or just this snippet:
```
epsilon :: Double
epsilon = r
where r = 1 - encodeFloat (m-1) e
(m, e) = decodeFloat (1 `asTypeOf` r)
```
This has a very simple value, but GHC refuses to compute it at compile time. This in turn inhibits other constant folding that should be going on.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Very poor constant folding","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"GHC seems to lack constant folding for encodeFloat/decodeFloat.\r\nFor many examples, compile the numeric-limits package on hackage, or just this snippet:\r\n{{{\r\nepsilon :: Double\r\nepsilon = r\r\n where r = 1 - encodeFloat (m-1) e\r\n (m, e) = decodeFloat (1 `asTypeOf` r)\r\n}}}\r\nThis has a very simple value, but GHC refuses to compute it at compile time. This in turn inhibits other constant folding that should be going on.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>https://gitlab.haskell.org/ghc/ghc/-/issues/6116ctrl-c doesn't always work when entering text in ghci2019-07-07T18:52:06Zjudahjctrl-c doesn't always work when entering text in ghciWith ghci-7.5.20120519 (on Mac and probably also Linux): type some text, then press ctrl-c. Then type more text, and press ctrl-c again. The first time you press ctrl-c, it starts a new line. But the second time you press ctrl-c, nothing...With ghci-7.5.20120519 (on Mac and probably also Linux): type some text, then press ctrl-c. Then type more text, and press ctrl-c again. The first time you press ctrl-c, it starts a new line. But the second time you press ctrl-c, nothing happens. (Actually running code from within ghci resets this process.)
This is a regression from the behavior of ghci-7.4.1, where every time you press ctrl-C it caused a new line to be printed.
From my initial investigation, I think this was caused by ghc commit 206c8fc3ebd64c40ae09742fdea09ffd0f915d5c, which was used to fix #2786.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ctrl-c doesn't always work when entering text in ghci","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"With ghci-7.5.20120519 (on Mac and probably also Linux): type some text, then press ctrl-c. Then type more text, and press ctrl-c again. The first time you press ctrl-c, it starts a new line. But the second time you press ctrl-c, nothing happens. (Actually running code from within ghci resets this process.)\r\n\r\nThis is a regression from the behavior of ghci-7.4.1, where every time you press ctrl-C it caused a new line to be printed.\r\n\r\nFrom my initial investigation, I think this was caused by ghc commit 206c8fc3ebd64c40ae09742fdea09ffd0f915d5c, which was used to fix #2786. ","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/6097tc078(hpc,optasm,profasm) are failing with core lint errors2019-07-07T18:52:12ZIan Lynagh <igloo@earth.li>tc078(hpc,optasm,profasm) are failing with core lint errors`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)
```...`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)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"tc078(hpc,optasm,profasm) are failing with core lint errors","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"7.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"`tc078(hpc,optasm,profasm)` are failing with core lint errors.\r\n\r\nHere's the code:\r\n{{{\r\n-- !!! instance decls with no binds\r\n--\r\nmodule ShouldFail where\r\n\r\ndata Bar a = MkBar Int a\r\n\r\ninstance Eq a => Eq (Bar a)\r\ninstance Ord a => Ord (Bar a)\r\n}}}\r\n\r\nAnd the `optasm` failure:\r\n{{{\r\n=====> tc078(optasm) 75 of 326 [0, 0, 0]\r\ncd . && '/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\r\nCompile failed (status 256) errors were:\r\n*** Core Lint errors : in result of Common sub-expression ***\r\n<no location info>: Warning:\r\n [RHS of $cmax_ah8 :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5\r\n -> ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5]\r\n The type of this binder doesn't match the type of its RHS: $cmax_ah8\r\n Binder's type: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5\r\n -> ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5\r\n Rhs type: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool\r\n*** Offending Program ***\r\nRec {\r\n$c==_agv [InlPrag=INLINE (sat-args=2), Occ=LoopBreaker]\r\n :: forall a_ag6.\r\n GHC.Classes.Eq a_ag6 =>\r\n ShouldFail.Bar a_ag6 -> ShouldFail.Bar a_ag6 -> GHC.Types.Bool\r\n[LclId,\r\n Arity=3,\r\n Str=DmdType AAAb,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=True)\r\n Tmpl= \\ (@ a_ag6)\r\n ($dEq_agt [Occ=Once] :: GHC.Classes.Eq a_ag6)\r\n (x_ahu [Occ=Once] :: ShouldFail.Bar a_ag6)\r\n (y_ahv [Occ=Once] :: ShouldFail.Bar a_ag6) ->\r\n $c==_agv @ a_ag6 $dEq_agt x_ahu y_ahv}]\r\n$c==_agv =\r\n \\ (@ a_ag6)\r\n ($dEq_agt :: GHC.Classes.Eq a_ag6)\r\n (eta_B2 :: ShouldFail.Bar a_ag6)\r\n (eta_B1 :: ShouldFail.Bar a_ag6) ->\r\n $c==_agv @ a_ag6 $dEq_agt eta_B2 eta_B1\r\nend Rec }\r\n\r\n$c/=_agz [InlPrag=INLINE (sat-args=2)]\r\n :: forall a_ag6.\r\n GHC.Classes.Eq a_ag6 =>\r\n ShouldFail.Bar a_ag6 -> ShouldFail.Bar a_ag6 -> GHC.Types.Bool\r\n[LclId,\r\n Arity=3,\r\n Str=DmdType AAAb,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=True)\r\n Tmpl= \\ (@ a_ag6)\r\n ($dEq_agt [Occ=Once] :: GHC.Classes.Eq a_ag6)\r\n (x_ahk [Occ=Once] :: ShouldFail.Bar a_ag6)\r\n (y_ahl [Occ=Once] :: ShouldFail.Bar a_ag6) ->\r\n $c==_agv @ a_ag6 $dEq_agt x_ahk y_ahl}]\r\n$c/=_agz = $c==_agv\r\n\r\nShouldFail.$fEqBar [InlPrag=[ALWAYS] CONLIKE]\r\n :: forall a_ag6.\r\n GHC.Classes.Eq a_ag6 =>\r\n GHC.Classes.Eq (ShouldFail.Bar a_ag6)\r\n[LclIdX[DFunId],\r\n Arity=1,\r\n Str=DmdType Lm,\r\n Unf=DFun(arity=2) GHC.Classes.D:Eq [$c==_agv, $c/=_agz]]\r\nShouldFail.$fEqBar =\r\n \\ (@ a_ag6) ($dEq_agt [Dmd=Just L] :: GHC.Classes.Eq a_ag6) ->\r\n GHC.Classes.D:Eq\r\n @ (ShouldFail.Bar a_ag6)\r\n ($c==_agv @ a_ag6 $dEq_agt)\r\n ($c/=_agz @ a_ag6 $dEq_agt)\r\n\r\n$c$p1Ord_agG\r\n :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n GHC.Classes.Eq (ShouldFail.Bar a_ag5)\r\n[LclId,\r\n Arity=1,\r\n Str=DmdType Lm,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=1, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)\r\n Tmpl= \\ (@ a_ag5)\r\n ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5) ->\r\n ShouldFail.$fEqBar @ a_ag5 (GHC.Classes.$p1Ord @ a_ag5 $dOrd_agD)}]\r\n$c$p1Ord_agG =\r\n \\ (@ a_ag5) ($dOrd_agD :: GHC.Classes.Ord a_ag5) ->\r\n ShouldFail.$fEqBar @ a_ag5 (GHC.Classes.$p1Ord @ a_ag5 $dOrd_agD)\r\n\r\neta_skd :: forall a_ag5. ShouldFail.Bar a_ag5\r\n[LclId]\r\neta_skd =\r\n \\ (@ a_ag5) ->\r\n Control.Exception.Base.absentError\r\n @ (ShouldFail.Bar a_ag5)\r\n \"w_sk3{v} [lid] main:ShouldFail.Bar{tc r9Z} a{tv ag5} [tv]\"\r\n\r\neta_skc :: forall a_ag5. ShouldFail.Bar a_ag5\r\n[LclId]\r\neta_skc =\r\n \\ (@ a_ag5) ->\r\n Control.Exception.Base.absentError\r\n @ (ShouldFail.Bar a_ag5)\r\n \"w_sk2{v} [lid] main:ShouldFail.Bar{tc r9Z} a{tv ag5} [tv]\"\r\n\r\n$dOrd_skb :: forall a_ag5. GHC.Classes.Ord a_ag5\r\n[LclId]\r\n$dOrd_skb =\r\n \\ (@ a_ag5) ->\r\n Control.Exception.Base.absentError\r\n @ (GHC.Classes.Ord a_ag5)\r\n \"w_sk1{v} [lid] ghc-prim:GHC.Classes.Ord{tc 2c} a{tv ag5} [tv]\"\r\n\r\nlvl_skh :: forall a_ag5. GHC.Classes.Eq a_ag5\r\n[LclId]\r\nlvl_skh =\r\n \\ (@ a_ag5) -> GHC.Classes.$p1Ord @ a_ag5 ($dOrd_skb @ a_ag5)\r\n\r\n$w$ccompare_sk5 :: forall a_ag5. GHC.Types.Ordering\r\n[LclId, Str=DmdType b]\r\n$w$ccompare_sk5 =\r\n \\ (@ a_ag5) ->\r\n case $c==_agv\r\n @ a_ag5 (lvl_skh @ a_ag5) (eta_skc @ a_ag5) (eta_skd @ a_ag5)\r\n of wild_00 {\r\n }\r\n\r\n$ccompare_agI [InlPrag=INLINE[0]]\r\n :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Ordering\r\n[LclId,\r\n Arity=3,\r\n Str=DmdType AAAb,\r\n Unf=Unf{Src=Worker=$w$ccompare_sk5, TopLvl=True, Arity=3,\r\n Value=True, ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=True)\r\n Tmpl= \\ (@ a_ag5) _ _ _ -> $w$ccompare_sk5 @ a_ag5}]\r\n$ccompare_agI = \\ (@ a_ag5) _ _ _ -> $w$ccompare_sk5 @ a_ag5\r\n\r\n$c<=_ah4\r\n :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool\r\n[LclId,\r\n Arity=3,\r\n Str=DmdType AAAb,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)\r\n Tmpl= \\ (@ a_ag5)\r\n ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)\r\n (x_ahU [Occ=Once] :: ShouldFail.Bar a_ag5)\r\n (y_ahV [Occ=Once] :: ShouldFail.Bar a_ag5) ->\r\n case $ccompare_agI @ a_ag5 $dOrd_agD x_ahU y_ahV of _ { }}]\r\n$c<=_ah4 = \\ (@ a_ag5) _ _ _ -> case $w$ccompare_sk5 of wild_00 { }\r\n\r\n$c<_agS\r\n :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool\r\n[LclId,\r\n Arity=3,\r\n Str=DmdType AAAb,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)\r\n Tmpl= \\ (@ a_ag5)\r\n ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)\r\n (x_aii [Occ=Once] :: ShouldFail.Bar a_ag5)\r\n (y_aij [Occ=Once] :: ShouldFail.Bar a_ag5) ->\r\n case $ccompare_agI @ a_ag5 $dOrd_agD x_aii y_aij of _ { }}]\r\n$c<_agS = $c<=_ah4\r\n\r\n$c>=_agW\r\n :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool\r\n[LclId,\r\n Arity=3,\r\n Str=DmdType AAAb,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)\r\n Tmpl= \\ (@ a_ag5)\r\n ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)\r\n (x_aia [Occ=Once] :: ShouldFail.Bar a_ag5)\r\n (y_aib [Occ=Once] :: ShouldFail.Bar a_ag5) ->\r\n case $ccompare_agI @ a_ag5 $dOrd_agD x_aia y_aib of _ { }}]\r\n$c>=_agW = $c<=_ah4\r\n\r\n$c>_ah0\r\n :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Bool\r\n[LclId,\r\n Arity=3,\r\n Str=DmdType AAAb,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)\r\n Tmpl= \\ (@ a_ag5)\r\n ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)\r\n (x_ai2 [Occ=Once] :: ShouldFail.Bar a_ag5)\r\n (y_ai3 [Occ=Once] :: ShouldFail.Bar a_ag5) ->\r\n case $ccompare_agI @ a_ag5 $dOrd_agD x_ai2 y_ai3 of _ { }}]\r\n$c>_ah0 = $c<=_ah4\r\n\r\n$cmax_ah8\r\n :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5\r\n -> ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5\r\n[LclId,\r\n Arity=3,\r\n Str=DmdType ASSb,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)\r\n Tmpl= \\ (@ a_ag5)\r\n ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)\r\n (x_ahK [Occ=Once] :: ShouldFail.Bar a_ag5)\r\n (y_ahL [Occ=Once] :: ShouldFail.Bar a_ag5) ->\r\n case $ccompare_agI @ a_ag5 $dOrd_agD x_ahK y_ahL of _ { }}]\r\n$cmax_ah8 = $c<=_ah4\r\n\r\n$cmin_ahc\r\n :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n ShouldFail.Bar a_ag5\r\n -> ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5\r\n[LclId,\r\n Arity=3,\r\n Str=DmdType ASSb,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=3, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)\r\n Tmpl= \\ (@ a_ag5)\r\n ($dOrd_agD [Occ=Once] :: GHC.Classes.Ord a_ag5)\r\n (x_ahy [Occ=Once] :: ShouldFail.Bar a_ag5)\r\n (y_ahz [Occ=Once] :: ShouldFail.Bar a_ag5) ->\r\n case $ccompare_agI @ a_ag5 $dOrd_agD x_ahy y_ahz of _ { }}]\r\n$cmin_ahc = $c<=_ah4\r\n\r\nlvl_ski\r\n :: forall a_ag5.\r\n ShouldFail.Bar a_ag5 -> ShouldFail.Bar a_ag5 -> GHC.Types.Ordering\r\n[LclId, Arity=2, Str=DmdType TTb]\r\nlvl_ski = \\ (@ a_ag5) _ _ -> $w$ccompare_sk5 @ a_ag5\r\n\r\nShouldFail.$fOrdBar [InlPrag=[ALWAYS] CONLIKE]\r\n :: forall a_ag5.\r\n GHC.Classes.Ord a_ag5 =>\r\n GHC.Classes.Ord (ShouldFail.Bar a_ag5)\r\n[LclIdX[DFunId],\r\n Arity=1,\r\n Str=DmdType Lm,\r\n Unf=DFun(arity=2) GHC.Classes.D:Ord [$c$p1Ord_agG, $ccompare_agI,\r\n $c<_agS, $c>=_agW, $c>_ah0, $c<=_ah4, $cmax_ah8, $cmin_ahc]]\r\nShouldFail.$fOrdBar =\r\n \\ (@ a_ag5) ($dOrd_agD [Dmd=Just L] :: GHC.Classes.Ord a_ag5) ->\r\n GHC.Classes.D:Ord\r\n @ (ShouldFail.Bar a_ag5)\r\n ($c$p1Ord_agG @ a_ag5 $dOrd_agD)\r\n (lvl_ski @ a_ag5)\r\n ($c<_agS @ a_ag5 $dOrd_agD)\r\n ($c>=_agW @ a_ag5 $dOrd_agD)\r\n ($c>_ah0 @ a_ag5 $dOrd_agD)\r\n ($c<=_ah4 @ a_ag5 $dOrd_agD)\r\n ($cmax_ah8 @ a_ag5 $dOrd_agD)\r\n ($cmin_ahc @ a_ag5 $dOrd_agD)\r\n\r\n*** End of Offense ***\r\n\r\n\r\n<no location info>: \r\nCompilation had errors\r\n\r\n\r\n\r\n*** unexpected failure for tc078(optasm)\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Simon Peyton JonesSimon Peyton Joneshttps://gitlab.haskell.org/ghc/ghc/-/issues/6096tc126(optasm) is failing with a core lint error2019-07-07T18:52:12ZIan Lynagh <igloo@earth.li>tc126(optasm) is failing with a core lint error`tc126(optasm)` is failing with a core lint error.
The code:
```
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
FlexibleInstances, FlexibleContexts, UndecidableInstances #-}
-- UndecidableInstances now needed ...`tc126(optasm)` is failing with a core lint error.
The code:
```
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
FlexibleInstances, FlexibleContexts, UndecidableInstances #-}
-- UndecidableInstances now needed because the Coverage Condition fails
-- !!! Functional dependency test. Hugs [Apr 2001] fails to typecheck this
-- Rather bizarre example submitted by Jonathon Bell
module ShouldCompile where
-- module Foo where
class Bug f a r | f a -> r where
bug::f->a->r
instance Bug (Int->r) Int r
instance (Bug f a r) => Bug f (c a) (c r)
f:: Bug(Int->Int) a r => a->r
f = bug (id::Int->Int)
g1 = f (f [0::Int])
-- Inner f gives result type
-- f [0::Int] :: Bug (Int->Int) [Int] r => r
-- Which matches the second instance declaration, giving r = [r']
-- f [0::Int] :: Bug (Int->Int) Int r' => r'
-- Wwich matches the first instance decl giving r' = Int
-- f [0::Int] :: Int
-- The outer f now has constraint
-- Bug (Int->Int) Int r
-- which makes r=Int
-- So g1::Int
g2 = f (f (f [0::Int]))
-- The outer f repeats the exercise, so g2::Int
-- This is the definition that Hugs rejects
```
The failure:
```
=====> tc126(optasm) 120 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 tc126.hs -O -fasm -fno-warn-incomplete-patterns >tc126.comp.stderr 2>&1
Compile failed (status 256) errors were:
tc126.hs:15:25: Warning:
No explicit method or default declaration for `bug'
In the instance declaration for `Bug (Int -> r) Int r'
tc126.hs:16:10: Warning:
No explicit method or default declaration for `bug'
In the instance declaration for `Bug f (c a) (c r)'
*** Core Lint errors : in result of Common sub-expression ***
{-# LINE 33 "tc126.hs #-}: Warning:
[RHS of ShouldCompile.g2 :: [GHC.Types.Int]]
The type of this binder doesn't match the type of its RHS: ShouldCompile.g2
Binder's type: [GHC.Types.Int]
Rhs type: [GHC.Types.Int] -> [GHC.Types.Int]
*** Offending Program ***
lvl_sbL
:: forall f_aal (c_aam :: * -> *) a_aan r_aao.
f_aal -> c_aam a_aan -> c_aam r_aao
[LclId, Str=DmdType b]
lvl_sbL =
\ (@ f_aal) (@ (c_aam :: * -> *)) (@ a_aan) (@ r_aao) ->
Control.Exception.Base.noMethodBindingError
@ (f_aal -> c_aam a_aan -> c_aam r_aao)
"tc126.hs:16:10-51|ShouldCompile.bug"
$cbug_abl
:: forall f_aal (c_aam :: * -> *) a_aan r_aao.
ShouldCompile.Bug f_aal a_aan r_aao =>
f_aal -> c_aam a_aan -> c_aam r_aao
[LclId,
Arity=1,
Str=DmdType Ab,
Unf=Unf{Src=InlineStable, TopLvl=True, Arity=1, Value=True,
ConLike=True, WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=True)
Tmpl= \ (@ f_aal) (@ (c_aam :: * -> *)) (@ a_aan) (@ r_aao) _ ->
lvl_sbL @ f_aal @ c_aam @ a_aan @ r_aao}]
$cbug_abl =
\ (@ f_aal) (@ (c_aam :: * -> *)) (@ a_aan) (@ r_aao) _ ->
lvl_sbL @ f_aal @ c_aam @ a_aan @ r_aao
ShouldCompile.$fBugfcc [InlPrag=INLINE (sat-args=0)]
:: forall f_aal (c_aam :: * -> *) a_aan r_aao.
ShouldCompile.Bug f_aal a_aan r_aao =>
ShouldCompile.Bug f_aal (c_aam a_aan) (c_aam r_aao)
[LclIdX[DFunId(nt)],
Arity=1,
Str=DmdType Ab,
Unf=Unf{Src=InlineStable, TopLvl=True, Arity=1, Value=True,
ConLike=True, WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=True)
Tmpl= $cbug_abl
`cast` (forall f_aal (c_aam :: * -> *) a_aan r_aao.
<ShouldCompile.Bug f_aal a_aan r_aao>
-> Sym
<(ShouldCompile.NTCo:Bug <f_aal> <c_aam a_aan> <c_aam r_aao>)>
:: (forall f_aal (c_aam :: * -> *) a_aan r_aao.
ShouldCompile.Bug f_aal a_aan r_aao =>
f_aal -> c_aam a_aan -> c_aam r_aao)
~#
(forall f_aal (c_aam :: * -> *) a_aan r_aao.
ShouldCompile.Bug f_aal a_aan r_aao =>
ShouldCompile.Bug f_aal (c_aam a_aan) (c_aam r_aao)))}]
ShouldCompile.$fBugfcc =
(\ (@ f_aal)
(@ (c_aam :: * -> *))
(@ a_aan)
(@ r_aao)
(eta_B1 :: ShouldCompile.Bug f_aal a_aan r_aao) ->
$cbug_abl @ f_aal @ c_aam @ a_aan @ r_aao eta_B1)
`cast` (forall f_aal (c_aam :: * -> *) a_aan r_aao.
<ShouldCompile.Bug f_aal a_aan r_aao>
-> Sym
<(ShouldCompile.NTCo:Bug <f_aal> <c_aam a_aan> <c_aam r_aao>)>
:: (forall f_aal (c_aam :: * -> *) a_aan r_aao.
ShouldCompile.Bug f_aal a_aan r_aao =>
f_aal -> c_aam a_aan -> c_aam r_aao)
~#
(forall f_aal (c_aam :: * -> *) a_aan r_aao.
ShouldCompile.Bug f_aal a_aan r_aao =>
ShouldCompile.Bug f_aal (c_aam a_aan) (c_aam r_aao)))
$cbug_abh
:: forall r_aap. (GHC.Types.Int -> r_aap) -> GHC.Types.Int -> r_aap
[LclId, Str=DmdType b]
$cbug_abh =
\ (@ r_aap) ->
Control.Exception.Base.noMethodBindingError
@ ((GHC.Types.Int -> r_aap) -> GHC.Types.Int -> r_aap)
"tc126.hs:15:25-47|ShouldCompile.bug"
ShouldCompile.$fBug(->)Intr [InlPrag=INLINE (sat-args=0)]
:: forall r_aap.
ShouldCompile.Bug (GHC.Types.Int -> r_aap) GHC.Types.Int r_aap
[LclIdX[DFunId(nt)],
Str=DmdType b,
Unf=Unf{Src=InlineStable, TopLvl=True, Arity=0, Value=False,
ConLike=False, WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=True)
Tmpl= $cbug_abh
`cast` (forall r_aap.
Sym
<(ShouldCompile.NTCo:Bug
<GHC.Types.Int -> r_aap> <GHC.Types.Int> <r_aap>)>
:: (forall r_aap.
(GHC.Types.Int -> r_aap) -> GHC.Types.Int -> r_aap)
~#
(forall r_aap.
ShouldCompile.Bug (GHC.Types.Int -> r_aap) GHC.Types.Int r_aap))}]
ShouldCompile.$fBug(->)Intr =
$cbug_abh
`cast` (forall r_aap.
Sym
<(ShouldCompile.NTCo:Bug
<GHC.Types.Int -> r_aap> <GHC.Types.Int> <r_aap>)>
:: (forall r_aap.
(GHC.Types.Int -> r_aap) -> GHC.Types.Int -> r_aap)
~#
(forall r_aap.
ShouldCompile.Bug (GHC.Types.Int -> r_aap) GHC.Types.Int r_aap))
$sf_sbw :: [GHC.Types.Int] -> [GHC.Types.Int]
[LclId, Str=DmdType b]
$sf_sbw = case lvl_sbL of wild_00 { }
ShouldCompile.f
:: forall a_aaf r_aag.
ShouldCompile.Bug (GHC.Types.Int -> GHC.Types.Int) a_aaf r_aag =>
a_aaf -> r_aag
[LclIdX,
Arity=1,
Str=DmdType C(S),
RULES: "SPEC ShouldCompile.f [[GHC.Types.Int], [GHC.Types.Int]]" [ALWAYS]
forall ($dBug_XbY
:: ShouldCompile.Bug
(GHC.Types.Int -> GHC.Types.Int) [GHC.Types.Int] [GHC.Types.Int]).
ShouldCompile.f @ [GHC.Types.Int] @ [GHC.Types.Int] $dBug_XbY
= $sf_sbw]
ShouldCompile.f =
\ (@ a_a)
(@ r_b)
($dBug_aaQ
:: ShouldCompile.Bug (GHC.Types.Int -> GHC.Types.Int) a_a r_b) ->
($dBug_aaQ
`cast` (<ShouldCompile.NTCo:Bug
<GHC.Types.Int -> GHC.Types.Int> <a_a> <r_b>>
:: ShouldCompile.Bug (GHC.Types.Int -> GHC.Types.Int) a_a r_b
~#
((GHC.Types.Int -> GHC.Types.Int) -> a_a -> r_b)))
(GHC.Base.id @ GHC.Types.Int)
ShouldCompile.g2 :: [GHC.Types.Int]
[LclIdX, Str=DmdType b]
ShouldCompile.g2 = $sf_sbw
ShouldCompile.g1 :: [GHC.Types.Int]
[LclIdX, Str=DmdType b]
ShouldCompile.g1 = $sf_sbw
*** End of Offense ***
<no location info>:
Compilation had errors
*** unexpected failure for tc126(optasm)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"tc126(optasm) is failing with a core lint error","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"7.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"`tc126(optasm)` is failing with a core lint error.\r\n\r\nThe code:\r\n{{{\r\n{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,\r\n FlexibleInstances, FlexibleContexts, UndecidableInstances #-}\r\n-- UndecidableInstances now needed because the Coverage Condition fails\r\n\r\n-- !!! Functional dependency test. Hugs [Apr 2001] fails to typecheck this\r\n-- Rather bizarre example submitted by Jonathon Bell\r\n\r\nmodule ShouldCompile where\r\n\r\n-- module Foo where\r\n\r\nclass Bug f a r | f a -> r where\r\n bug::f->a->r\r\n\r\ninstance Bug (Int->r) Int r\r\ninstance (Bug f a r) => Bug f (c a) (c r) \r\n\r\nf:: Bug(Int->Int) a r => a->r\r\nf = bug (id::Int->Int)\r\n\r\ng1 = f (f [0::Int])\r\n-- Inner f gives result type \r\n-- f [0::Int] :: Bug (Int->Int) [Int] r => r\r\n-- Which matches the second instance declaration, giving r = [r']\r\n-- f [0::Int] :: Bug (Int->Int) Int r' => r'\r\n-- Wwich matches the first instance decl giving r' = Int\r\n-- f [0::Int] :: Int\r\n-- The outer f now has constraint\r\n-- Bug (Int->Int) Int r\r\n-- which makes r=Int\r\n-- So g1::Int\r\n\r\ng2 = f (f (f [0::Int]))\r\n-- The outer f repeats the exercise, so g2::Int\r\n-- This is the definition that Hugs rejects\r\n}}}\r\n\r\nThe failure:\r\n{{{\r\n=====> tc126(optasm) 120 of 326 [0, 0, 0]\r\ncd . && '/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 tc126.hs -O -fasm -fno-warn-incomplete-patterns >tc126.comp.stderr 2>&1\r\nCompile failed (status 256) errors were:\r\n\r\ntc126.hs:15:25: Warning:\r\n No explicit method or default declaration for `bug'\r\n In the instance declaration for `Bug (Int -> r) Int r'\r\n\r\ntc126.hs:16:10: Warning:\r\n No explicit method or default declaration for `bug'\r\n In the instance declaration for `Bug f (c a) (c r)'\r\n*** Core Lint errors : in result of Common sub-expression ***\r\n{-# LINE 33 \"tc126.hs #-}: Warning:\r\n [RHS of ShouldCompile.g2 :: [GHC.Types.Int]]\r\n The type of this binder doesn't match the type of its RHS: ShouldCompile.g2\r\n Binder's type: [GHC.Types.Int]\r\n Rhs type: [GHC.Types.Int] -> [GHC.Types.Int]\r\n*** Offending Program ***\r\nlvl_sbL\r\n :: forall f_aal (c_aam :: * -> *) a_aan r_aao.\r\n f_aal -> c_aam a_aan -> c_aam r_aao\r\n[LclId, Str=DmdType b]\r\nlvl_sbL =\r\n \\ (@ f_aal) (@ (c_aam :: * -> *)) (@ a_aan) (@ r_aao) ->\r\n Control.Exception.Base.noMethodBindingError\r\n @ (f_aal -> c_aam a_aan -> c_aam r_aao)\r\n \"tc126.hs:16:10-51|ShouldCompile.bug\"\r\n\r\n$cbug_abl\r\n :: forall f_aal (c_aam :: * -> *) a_aan r_aao.\r\n ShouldCompile.Bug f_aal a_aan r_aao =>\r\n f_aal -> c_aam a_aan -> c_aam r_aao\r\n[LclId,\r\n Arity=1,\r\n Str=DmdType Ab,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=1, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=True)\r\n Tmpl= \\ (@ f_aal) (@ (c_aam :: * -> *)) (@ a_aan) (@ r_aao) _ ->\r\n lvl_sbL @ f_aal @ c_aam @ a_aan @ r_aao}]\r\n$cbug_abl =\r\n \\ (@ f_aal) (@ (c_aam :: * -> *)) (@ a_aan) (@ r_aao) _ ->\r\n lvl_sbL @ f_aal @ c_aam @ a_aan @ r_aao\r\n\r\nShouldCompile.$fBugfcc [InlPrag=INLINE (sat-args=0)]\r\n :: forall f_aal (c_aam :: * -> *) a_aan r_aao.\r\n ShouldCompile.Bug f_aal a_aan r_aao =>\r\n ShouldCompile.Bug f_aal (c_aam a_aan) (c_aam r_aao)\r\n[LclIdX[DFunId(nt)],\r\n Arity=1,\r\n Str=DmdType Ab,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=1, Value=True,\r\n ConLike=True, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=True)\r\n Tmpl= $cbug_abl\r\n `cast` (forall f_aal (c_aam :: * -> *) a_aan r_aao.\r\n <ShouldCompile.Bug f_aal a_aan r_aao>\r\n -> Sym\r\n <(ShouldCompile.NTCo:Bug <f_aal> <c_aam a_aan> <c_aam r_aao>)>\r\n :: (forall f_aal (c_aam :: * -> *) a_aan r_aao.\r\n ShouldCompile.Bug f_aal a_aan r_aao =>\r\n f_aal -> c_aam a_aan -> c_aam r_aao)\r\n ~#\r\n (forall f_aal (c_aam :: * -> *) a_aan r_aao.\r\n ShouldCompile.Bug f_aal a_aan r_aao =>\r\n ShouldCompile.Bug f_aal (c_aam a_aan) (c_aam r_aao)))}]\r\nShouldCompile.$fBugfcc =\r\n (\\ (@ f_aal)\r\n (@ (c_aam :: * -> *))\r\n (@ a_aan)\r\n (@ r_aao)\r\n (eta_B1 :: ShouldCompile.Bug f_aal a_aan r_aao) ->\r\n $cbug_abl @ f_aal @ c_aam @ a_aan @ r_aao eta_B1)\r\n `cast` (forall f_aal (c_aam :: * -> *) a_aan r_aao.\r\n <ShouldCompile.Bug f_aal a_aan r_aao>\r\n -> Sym\r\n <(ShouldCompile.NTCo:Bug <f_aal> <c_aam a_aan> <c_aam r_aao>)>\r\n :: (forall f_aal (c_aam :: * -> *) a_aan r_aao.\r\n ShouldCompile.Bug f_aal a_aan r_aao =>\r\n f_aal -> c_aam a_aan -> c_aam r_aao)\r\n ~#\r\n (forall f_aal (c_aam :: * -> *) a_aan r_aao.\r\n ShouldCompile.Bug f_aal a_aan r_aao =>\r\n ShouldCompile.Bug f_aal (c_aam a_aan) (c_aam r_aao)))\r\n\r\n$cbug_abh\r\n :: forall r_aap. (GHC.Types.Int -> r_aap) -> GHC.Types.Int -> r_aap\r\n[LclId, Str=DmdType b]\r\n$cbug_abh =\r\n \\ (@ r_aap) ->\r\n Control.Exception.Base.noMethodBindingError\r\n @ ((GHC.Types.Int -> r_aap) -> GHC.Types.Int -> r_aap)\r\n \"tc126.hs:15:25-47|ShouldCompile.bug\"\r\n\r\nShouldCompile.$fBug(->)Intr [InlPrag=INLINE (sat-args=0)]\r\n :: forall r_aap.\r\n ShouldCompile.Bug (GHC.Types.Int -> r_aap) GHC.Types.Int r_aap\r\n[LclIdX[DFunId(nt)],\r\n Str=DmdType b,\r\n Unf=Unf{Src=InlineStable, TopLvl=True, Arity=0, Value=False,\r\n ConLike=False, WorkFree=True, Expandable=True,\r\n Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=True)\r\n Tmpl= $cbug_abh\r\n `cast` (forall r_aap.\r\n Sym\r\n <(ShouldCompile.NTCo:Bug\r\n <GHC.Types.Int -> r_aap> <GHC.Types.Int> <r_aap>)>\r\n :: (forall r_aap.\r\n (GHC.Types.Int -> r_aap) -> GHC.Types.Int -> r_aap)\r\n ~#\r\n (forall r_aap.\r\n ShouldCompile.Bug (GHC.Types.Int -> r_aap) GHC.Types.Int r_aap))}]\r\nShouldCompile.$fBug(->)Intr =\r\n $cbug_abh\r\n `cast` (forall r_aap.\r\n Sym\r\n <(ShouldCompile.NTCo:Bug\r\n <GHC.Types.Int -> r_aap> <GHC.Types.Int> <r_aap>)>\r\n :: (forall r_aap.\r\n (GHC.Types.Int -> r_aap) -> GHC.Types.Int -> r_aap)\r\n ~#\r\n (forall r_aap.\r\n ShouldCompile.Bug (GHC.Types.Int -> r_aap) GHC.Types.Int r_aap))\r\n\r\n$sf_sbw :: [GHC.Types.Int] -> [GHC.Types.Int]\r\n[LclId, Str=DmdType b]\r\n$sf_sbw = case lvl_sbL of wild_00 { }\r\n\r\nShouldCompile.f\r\n :: forall a_aaf r_aag.\r\n ShouldCompile.Bug (GHC.Types.Int -> GHC.Types.Int) a_aaf r_aag =>\r\n a_aaf -> r_aag\r\n[LclIdX,\r\n Arity=1,\r\n Str=DmdType C(S),\r\n RULES: \"SPEC ShouldCompile.f [[GHC.Types.Int], [GHC.Types.Int]]\" [ALWAYS]\r\n forall ($dBug_XbY\r\n :: ShouldCompile.Bug\r\n (GHC.Types.Int -> GHC.Types.Int) [GHC.Types.Int] [GHC.Types.Int]).\r\n ShouldCompile.f @ [GHC.Types.Int] @ [GHC.Types.Int] $dBug_XbY\r\n = $sf_sbw]\r\nShouldCompile.f =\r\n \\ (@ a_a)\r\n (@ r_b)\r\n ($dBug_aaQ\r\n :: ShouldCompile.Bug (GHC.Types.Int -> GHC.Types.Int) a_a r_b) ->\r\n ($dBug_aaQ\r\n `cast` (<ShouldCompile.NTCo:Bug\r\n <GHC.Types.Int -> GHC.Types.Int> <a_a> <r_b>>\r\n :: ShouldCompile.Bug (GHC.Types.Int -> GHC.Types.Int) a_a r_b\r\n ~#\r\n ((GHC.Types.Int -> GHC.Types.Int) -> a_a -> r_b)))\r\n (GHC.Base.id @ GHC.Types.Int)\r\n\r\nShouldCompile.g2 :: [GHC.Types.Int]\r\n[LclIdX, Str=DmdType b]\r\nShouldCompile.g2 = $sf_sbw\r\n\r\nShouldCompile.g1 :: [GHC.Types.Int]\r\n[LclIdX, Str=DmdType b]\r\nShouldCompile.g1 = $sf_sbw\r\n\r\n*** End of Offense ***\r\n\r\n\r\n<no location info>: \r\nCompilation had errors\r\n\r\n\r\n\r\n*** unexpected failure for tc126(optasm)\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/6082Program compiled with 7.4.1 runs many times slower than compiled with 7.2.22019-07-07T18:52:17ZgchrupalaProgram compiled with 7.4.1 runs many times slower than compiled with 7.2.2The morfette program (http://hackage.haskell.org/package/morfette), when compiled with 7.4.1 runs extremely slow: approx. 20x times slower than when compiled with 7.2.1.
To reproduce, install morfette using both compilers, and run it on...The morfette program (http://hackage.haskell.org/package/morfette), when compiled with 7.4.1 runs extremely slow: approx. 20x times slower than when compiled with 7.2.1.
To reproduce, install morfette using both compilers, and run it on the attached \`sample' file.
```
morfette train sample output --iter-pos=10 --iter-lemma=3
```
I attach the output of the profiler for both compilers. It would seem the performance bug is related to code from the modules GramLab.Perceptron.Multiclass and GramLab.Perceptron.Vector
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Program compiled with 7.4.1 runs many times slower than compiled with 7.2.2","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The morfette program (http://hackage.haskell.org/package/morfette), when compiled with 7.4.1 runs extremely slow: approx. 20x times slower than when compiled with 7.2.1.\r\n\r\nTo reproduce, install morfette using both compilers, and run it on the attached `sample' file.\r\n\r\n{{{\r\nmorfette train sample output --iter-pos=10 --iter-lemma=3\r\n}}}\r\n\r\nI attach the output of the profiler for both compilers. It would seem the performance bug is related to code from the modules GramLab.Perceptron.Multiclass and GramLab.Perceptron.Vector\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1pcapriottipcapriottihttps://gitlab.haskell.org/ghc/ghc/-/issues/5977Allow ignoring global package db2019-07-07T18:52:44ZduncanAllow ignoring global package dbFor sandboxing, users want to be able to use only local package dbs. To handle rts, base etc, they copy those specific packages from the global package db into a local package db.
Currently however there is no sensible way to tell ghc t...For sandboxing, users want to be able to use only local package dbs. To handle rts, base etc, they copy those specific packages from the global package db into a local package db.
Currently however there is no sensible way to tell ghc to look **only** at the listed package dbs, and not the global db. There is a flag `-no-user-package-conf` to avoid looking at the per-user one, but no equivalent to ignore or to specify the global one.
(Note: as a quirky non-sensible way, you can use `GHC_PACKAGE_PATH=""` to clear the package db stack, but this should be possible using command line flags.)
The user interface we're now using in cabal is like this:
- `--global` sets the initial db stack to `[GlobalPackageDB]`
- `--user` sets the initial db stack to `[GlobalPackageDB, UserPackageDB]`
- `--package-db=clear` clears the db stack to `[]`
- `--package-db=global` pushes `GlobalPackageDB` on the top of the stack
- `--package-db=user` pushes `UserPackageDB` on the top of the stack
- `--package-db=`*${otherfile}* pushes `SpecificPackageDB` *${otherfile}* on the top of the stack
It seems to me we could do something similar with ghc. Currently in ghc we have a `-hide-all-packages` flag that resets the package set to empty. We could do with an equivalent for the package database stack. I suggest something like:
- `-clear-package-conf`
- `-global-package-conf`
- `-user-package-conf` (and the existing `-no-user-package-conf`)
- `-package-conf` file
The default would remain that the global and user dbs are used, but this can be reset using `-clear-package-conf`.
Personally I prefer the nomenclarture "package db" rather than "package conf" here, but it's not that important.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.4.1 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Allow ignoring global package db","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"For sandboxing, users want to be able to use only local package dbs. To handle rts, base etc, they copy those specific packages from the global package db into a local package db.\r\n\r\nCurrently however there is no sensible way to tell ghc to look '''only''' at the listed package dbs, and not the global db. There is a flag `-no-user-package-conf` to avoid looking at the per-user one, but no equivalent to ignore or to specify the global one.\r\n\r\n(Note: as a quirky non-sensible way, you can use `GHC_PACKAGE_PATH=\"\"` to clear the package db stack, but this should be possible using command line flags.)\r\n\r\nThe user interface we're now using in cabal is like this:\r\n\r\n * `--global` sets the initial db stack to `[GlobalPackageDB]`\r\n * `--user` sets the initial db stack to `[GlobalPackageDB, UserPackageDB]`\r\n * `--package-db=clear` clears the db stack to `[]`\r\n * `--package-db=global` pushes `GlobalPackageDB` on the top of the stack\r\n * `--package-db=user` pushes `UserPackageDB` on the top of the stack\r\n * `--package-db=`''${otherfile}'' pushes `SpecificPackageDB` ''${otherfile}'' on the top of the stack\r\n\r\nIt seems to me we could do something similar with ghc. Currently in ghc we have a `-hide-all-packages` flag that resets the package set to empty. We could do with an equivalent for the package database stack. I suggest something like:\r\n\r\n * `-clear-package-conf`\r\n * `-global-package-conf`\r\n * `-user-package-conf` (and the existing `-no-user-package-conf`)\r\n * `-package-conf` file\r\n\r\nThe default would remain that the global and user dbs are used, but this can be reset using `-clear-package-conf`.\r\n\r\nPersonally I prefer the nomenclarture \"package db\" rather than \"package conf\" here, but it's not that important.","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1pcapriottipcapriottihttps://gitlab.haskell.org/ghc/ghc/-/issues/5958Follow mtl upstream2019-07-07T18:52:51ZIan Lynagh <igloo@earth.li>Follow mtl upstreamAs per http://projects.haskell.org/pipermail/haskell-platform/2012-March/001760.html we should be tracking https://github.com/ekmett/mtl.git (which may mean asking upstream to merge our patches, if we have any) and will also need to trac...As per http://projects.haskell.org/pipermail/haskell-platform/2012-March/001760.html we should be tracking https://github.com/ekmett/mtl.git (which may mean asking upstream to merge our patches, if we have any) and will also need to track http://code.haskell.org/\~ross/transformers
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Follow mtl upstream","status":"New","operating_system":"","component":"Build System","related":[],"milestone":"7.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"As per http://projects.haskell.org/pipermail/haskell-platform/2012-March/001760.html we should be tracking https://github.com/ekmett/mtl.git (which may mean asking upstream to merge our patches, if we have any) and will also need to track http://code.haskell.org/~ross/transformers\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>