Test case compact_share fails with NCG with optimizations
Summary
Similar to #21978, #21977, etc., this test case works without optimizations, but fails when using any optimization level (such as with --test-way=optasm
), because it prints a different size.
Steps to reproduce
~/myghc/ghc/_build/stage1/bin/ghc compact_share.hs && ./compact_share
prints
411963
5177344
411963
2686976
as in compact_share.stdout-ws-64
But with optimizations -O
:
~/myghc/ghc/_build/stage1/bin/ghc -O compact_share.hs && ./compact_share
prints
411963
5308416
411963
2686976
See second number.
Expected behavior
I assume it should print the same value, otherwise, can the test case be adapted as not to fail using the optasm
way?
Environment
- GHC version used: main HEAD
Optional:
- Operating System: Ubuntu Linux 20.04
- System Architecture: x86_64