GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:40:57Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/9303O2: (GHC version 7.8.3 for x86_64-unknown-linux): allocateRegsAndSpill: Canno...2019-07-07T18:40:57ZSergei TrofimovichO2: (GHC version 7.8.3 for x86_64-unknown-linux): allocateRegsAndSpill: Cannot read from uninitialized register %vI_s1Mp```
ghc --make -O2 M.hs
[1 of 1] Compiling M ( M.hs, M.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.3 for x86_64-unknown-linux):
allocateRegsAndSpill: Cannot read from uninitialized register
...```
ghc --make -O2 M.hs
[1 of 1] Compiling M ( M.hs, M.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.3 for x86_64-unknown-linux):
allocateRegsAndSpill: Cannot read from uninitialized register
%vI_s1Mp
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
As in #9155 bug was caught on **wx** package in the same module.
I didn't try to trim it down to minimal sample.
No external modules required.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.8.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (NCG) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | simonmar |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"O2: (GHC version 7.8.3 for x86_64-unknown-linux): allocateRegsAndSpill: Cannot read from uninitialized register %vI_s1Mp","status":"New","operating_system":"","component":"Compiler (NCG)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["simonmar"],"type":"Bug","description":"{{{\r\nghc --make -O2 M.hs \r\n[1 of 1] Compiling M ( M.hs, M.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.8.3 for x86_64-unknown-linux):\r\n allocateRegsAndSpill: Cannot read from uninitialized register\r\n %vI_s1Mp\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\nAs in #9155 bug was caught on '''wx''' package in the same module.\r\nI didn't try to trim it down to minimal sample.\r\n\r\nNo external modules required.","type_of_failure":"OtherFailure","blocking":[]} -->7.8.4Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/9435x86 sse4.2 popCnt16# needs to zero-extend its result2019-07-07T18:40:24Zrwbartonx86 sse4.2 popCnt16# needs to zero-extend its result`make TEST=cgrun071 EXTRA_HC_OPTS=-msse42` fails for me in all the non-ghci non-llvm ways.
For `popCnt16#` we emit `popcnt %ax,%ax` which doesn't clear the high 48 bits of the result.
Patch incoming.
<details><summary>Trac metadata</s...`make TEST=cgrun071 EXTRA_HC_OPTS=-msse42` fails for me in all the non-ghci non-llvm ways.
For `popCnt16#` we emit `popcnt %ax,%ax` which doesn't clear the high 48 bits of the result.
Patch incoming.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | --------------- |
| Version | 7.9 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (NCG) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | simonmar, tibbe |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"x86 sse4.2 popCnt16# needs to zero-extend its result","status":"New","operating_system":"","component":"Compiler (NCG)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["simonmar","tibbe"],"type":"Bug","description":"`make TEST=cgrun071 EXTRA_HC_OPTS=-msse42` fails for me in all the non-ghci non-llvm ways.\r\n\r\nFor `popCnt16#` we emit `popcnt %ax,%ax` which doesn't clear the high 48 bits of the result.\r\n\r\nPatch incoming.","type_of_failure":"OtherFailure","blocking":[]} -->7.8.4