diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-10-06 10:45:55 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-08 18:11:43 -0400 |
commit | 55a6377a5d55d6e6e93cf3d087f1e2d17fe7d3f3 (patch) | |
tree | 3b8e21083edc0a9688e34dd11cce8005dfdba049 /testsuite/tests/parser/should_compile/T515.stderr | |
parent | 816d256114858d01c99503c10e3be86ecdb15173 (diff) | |
download | haskell-55a6377a5d55d6e6e93cf3d087f1e2d17fe7d3f3.tar.gz |
code gen: Disable dead code elimination when -finfo-table-map is enabled
It's important that when -finfo-table-map is enabled that we generate
IPE entries just for those info tables which are actually used. To this
end, the info tables which are used are collected just before code
generation starts and entries only created for those tables.
Not accounted for in this scheme was the dead code elimination in the
native code generator. When compiling GHC this optimisation removed an
info table which had an IPE entry which resulting in the following kind
of linker error:
```
/home/matt/ghc-with-debug/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20210928/libHSCabal-3.5.0.0-ghc9.3.20210928.so: error: undefined reference to '.Lc5sS_info'
/home/matt/ghc-with-debug/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20210928/libHSCabal-3.5.0.0-ghc9.3.20210928.so: error: undefined reference to '.Lc5sH_info'
/home/matt/ghc-with-debug/_build/stage1/lib/../lib/x86_64-linux-ghc-9.3.20210928/libHSCabal-3.5.0.0-ghc9.3.20210928.so: error: undefined reference to '.Lc5sm_info'
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
Development.Shake.cmd, system command failed
```
Unfortunately, by the time this optimisation happens the structure of
the CmmInfoTable has been lost, we only have the generated code for the
info table to play with so we can no longer just collect all the used
info tables and generate the IPE map.
This leaves us with two options:
1. Return a list of the names of the discarded info tables and then
remove them from the map. This is awkward because we need to do code
generation for the map as well.
2. Just disable this small code size optimisation when -finfo-table-map
is enabled. The option produces very big object files anyway.
Option 2 is much easier to implement and means we don't have to thread
information around awkwardly. It's at the cost of slightly larger object
files (as dead code is not eliminated).
Disabling this optimisation allows an IPE build of GHC to complete
successfully.
Fixes #20428
Diffstat (limited to 'testsuite/tests/parser/should_compile/T515.stderr')
0 files changed, 0 insertions, 0 deletions