Be aware of overlapping global STG registers in CmmSink (#10521)
authorReid Barton <rwbarton@gmail.com>
Thu, 25 Jun 2015 17:53:57 +0000 (13:53 -0400)
committerReid Barton <rwbarton@gmail.com>
Thu, 25 Jun 2015 17:53:58 +0000 (13:53 -0400)
commita2f828a370b220839ad9b31a274c0198ef91b7fe
treed4f238143f0dd7c891f90e9b2bd10b41c6470e19
parentc7b6fb59eca478650dcb391a6f424e3c42a155dc
Be aware of overlapping global STG registers in CmmSink (#10521)

Summary:
On x86_64, commit e2f6bbd3a27685bc667655fdb093734cb565b4cf assigned
the STG registers F1 and D1 the same hardware register (xmm1), and
the same for the registers F2 and D2, etc. When mixing calls to
functions involving Float#s and Double#s, this can cause wrong Cmm
optimizations that assume the F1 and D1 registers are independent.

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: simonpj, thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D993

GHC Trac Issues: #10521
compiler/cmm/CmmExpr.hs
compiler/cmm/CmmSink.hs
compiler/cmm/CmmUtils.hs
compiler/codeGen/StgCmmUtils.hs
includes/stg/MachRegs.h
testsuite/.gitignore
testsuite/tests/codeGen/should_run/T10521.hs [new file with mode: 0644]
testsuite/tests/codeGen/should_run/T10521.stdout [new file with mode: 0644]
testsuite/tests/codeGen/should_run/T10521b.hs [new file with mode: 0644]
testsuite/tests/codeGen/should_run/T10521b.stdout [new file with mode: 0644]
testsuite/tests/codeGen/should_run/all.T