34fde6c
From 3aff352bb01751cddeb2b18c26576337d1b46c90 Mon Sep 17 00:00:00 2001
0697d20
From: "Richard W.M. Jones" <rjones@redhat.com>
0697d20
Date: Thu, 28 May 2015 16:13:40 -0400
496d4e4
Subject: [PATCH 16/20] ppc64le: Fix calling convention of external functions
0697d20
 with > 8 parameters (RHBZ#1225995).
0697d20
0697d20
For external (ie. C) functions with more than 8 parameters, we must
0697d20
pass the first 8 parameters in registers and then all the remaining
0697d20
parameters on the stack.
0697d20
0697d20
Unfortunately the original backend copied the stack offset from ppc64,
0697d20
where it works, but the offset was wrong for ppc64le.
0697d20
0697d20
By experimentation I found the correct offset.
0697d20
---
0697d20
 asmcomp/power64le/proc.ml | 2 +-
0697d20
 1 file changed, 1 insertion(+), 1 deletion(-)
0697d20
0697d20
diff --git a/asmcomp/power64le/proc.ml b/asmcomp/power64le/proc.ml
0697d20
index 56473ac..c705695 100644
0697d20
--- a/asmcomp/power64le/proc.ml
0697d20
+++ b/asmcomp/power64le/proc.ml
0697d20
@@ -188,7 +188,7 @@ let poweropen_external_conventions first_int last_int
0697d20
 let loc_external_arguments =
0697d20
   match Config.system with
0697d20
   | "rhapsody" -> poweropen_external_conventions 0 7 100 112
0697d20
-  | "elf" | "bsd" -> calling_conventions 0 7 100 107 outgoing 48
0697d20
+  | "elf" | "bsd" -> calling_conventions 0 7 100 107 outgoing 32
0697d20
   | _ -> assert false
0697d20
 
0697d20
 let extcall_use_push = false
0697d20
-- 
496d4e4
2.7.4
0697d20