Fix join-point decision
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 9 Jan 2018 13:53:09 +0000 (13:53 +0000)
committerBen Gamari <ben@smart-cactus.org>
Mon, 15 Jan 2018 16:42:34 +0000 (11:42 -0500)
commit20afdaa75e269697c2f9608e6d29f720a6387d01
tree444557f351f3daa8df4171ea5404059821846e1f
parent7c69f1117695c7db1c10b1103995cc0111a4d8fb
Fix join-point decision

This patch moves the "ok_unfolding" test
   from  CoreOpt.joinPointBinding_maybe
   to    OccurAnal.decideJoinPointHood

Previously the occurrence analyser was deciding to make
something a join point, but the simplifier was reversing
that decision, which made the decision about /other/ bindings
invalid.

Fixes Trac #14650.

(cherry picked from commit 66ff794fedf6e81e727dc8f651e63afe6f2a874b)
compiler/coreSyn/CoreOpt.hs
compiler/simplCore/OccurAnal.hs
testsuite/tests/simplCore/should_compile/T14650.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/all.T