From 31a5818ed54da9863d962056cbba2bf3932be900 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Sat, 6 Dec 2014 18:21:21 +0100
Subject: [PATCH] Compiler [amd64]: Fixed F_*CALL_BUILTIN* --with-debug.

The use of ins_debug_instr_prologue() zapped ARG1_REG for at least
F_MARK_CALL_BUILTIN.
---
 src/code/amd64.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/code/amd64.c b/src/code/amd64.c
index 3d0bf67245..ed8e4d5a3e 100644
--- a/src/code/amd64.c
+++ b/src/code/amd64.c
@@ -3736,25 +3736,20 @@ void ins_f_byte_with_arg(unsigned int a, INT32 b)
   case F_MARK_CALL_BUILTIN:
     if(a == F_MARK_CALL_BUILTIN )
     {
-      /* Note: It is not actually possible to do ins_debug_instr_prologue
-         here.
-         ins_debug_instr_prologue(a-F_OFFSET, b, 0);
-      */
+      ins_debug_instr_prologue(a-F_OFFSET, b, 0);
       mov_imm_reg( 0, ARG1_REG );
     }
 
   case F_CALL_BUILTIN1:
     if(a == F_CALL_BUILTIN1 )
     {
-      /* Note: It is not actually possible to do ins_debug_instr_prologue
-         here.
-         ins_debug_instr_prologue(a-F_OFFSET, b, 0);
-      */
+      ins_debug_instr_prologue(a-F_OFFSET, b, 0);
       mov_imm_reg( 1, ARG1_REG );
     }
 
-    /* Get function pointer */
-    ins_debug_instr_prologue(a-F_OFFSET, b, 0);
+    /* Note: It is not actually possible to do ins_debug_instr_prologue
+     *       here.
+     */
     amd64_call_c_opcode(Pike_compiler->new_program->constants[b].sval.u.efun->function,
                         I_UPDATE_SP);
     return;
-- 
GitLab