From fc5aa5d8a0a7c7fc57cfe268f1e051e14c90b93b Mon Sep 17 00:00:00 2001
From: Simon Marlow <marlowsd@gmail.com>
Date: Mon, 24 Mar 2014 14:36:16 +0000
Subject: [PATCH] Use the correct callClobberedRegs on Windows/x64 (#8834)

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit c4eeacdfdf4578eb6e75bbf2e067bfe70ec94ab0)
---
 compiler/nativeGen/X86/Regs.hs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compiler/nativeGen/X86/Regs.hs b/compiler/nativeGen/X86/Regs.hs
index b5139c92bf11..127a81183175 100644
--- a/compiler/nativeGen/X86/Regs.hs
+++ b/compiler/nativeGen/X86/Regs.hs
@@ -403,6 +403,9 @@ callClobberedRegs       :: Platform -> [Reg]
 -- caller-saves registers
 callClobberedRegs platform
  | target32Bit platform = [eax,ecx,edx] ++ map regSingle (floatregnos platform)
+ | platformOS platform == OSMinGW32
+   = [rax,rcx,rdx,r8,r9,r10,r11]
+   ++ map regSingle (floatregnos platform)
  | otherwise
     -- all xmm regs are caller-saves
     -- caller-saves registers
-- 
GitLab