Arity: Require called *exactly once* for eta exp with -fpedantic-bottoms (#24296)
In #24296, we had a program in which we eta expanded away an error despite the presence of `-fpedantic-bottoms`. This was caused by turning called *at least once* lambdas into one-shot lambdas, while with `-fpedantic-bottoms` it is only sound to eta expand over lambdas that are called *exactly* once. An example can be found in `Note [Combining arity type with demand info]`. Fixes #24296.
Showing
- compiler/GHC/Core/Opt/Arity.hs 58 additions, 25 deletionscompiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/OccurAnal.hs 1 addition, 1 deletioncompiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Tidy.hs 1 addition, 1 deletioncompiler/GHC/Core/Tidy.hs
- compiler/GHC/CoreToStg.hs 5 additions, 5 deletionscompiler/GHC/CoreToStg.hs
- compiler/GHC/Iface/Type.hs 1 addition, 1 deletioncompiler/GHC/Iface/Type.hs
- compiler/GHC/Stg/Lift/Analysis.hs 4 additions, 4 deletionscompiler/GHC/Stg/Lift/Analysis.hs
- compiler/GHC/Types/Demand.hs 20 additions, 14 deletionscompiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Id/Make.hs 12 additions, 6 deletionscompiler/GHC/Types/Id/Make.hs
- testsuite/tests/arityanal/should_compile/T21755.stderr 27 additions, 1 deletiontestsuite/tests/arityanal/should_compile/T21755.stderr
- testsuite/tests/arityanal/should_compile/T24296b.hs 12 additions, 0 deletionstestsuite/tests/arityanal/should_compile/T24296b.hs
- testsuite/tests/arityanal/should_compile/T24296b.stderr 26 additions, 0 deletionstestsuite/tests/arityanal/should_compile/T24296b.stderr
- testsuite/tests/arityanal/should_compile/all.T 21 additions, 19 deletionstestsuite/tests/arityanal/should_compile/all.T
- testsuite/tests/arityanal/should_run/T24296.hs 20 additions, 0 deletionstestsuite/tests/arityanal/should_run/T24296.hs
- testsuite/tests/arityanal/should_run/T24296.stderr 3 additions, 0 deletionstestsuite/tests/arityanal/should_run/T24296.stderr
- testsuite/tests/arityanal/should_run/all.T 1 addition, 0 deletionstestsuite/tests/arityanal/should_run/all.T
Loading
Please register or sign in to comment