# HG changeset patch # User kono # Date 1049308416 -32400 # Node ID 948977254fa67ef9e67a522b8e59cb25f1b4e2d9 # Parent d497c39add364ccb8673822cfcce8c8df01f912e fix long argument call in code segement diff -r d497c39add36 -r 948977254fa6 mc-code-powerpc.c --- a/mc-code-powerpc.c Thu Apr 03 03:04:16 2003 +0900 +++ b/mc-code-powerpc.c Thu Apr 03 03:33:36 2003 +0900 @@ -153,6 +153,7 @@ #define r1_offset func_disp_offset+12 int code_disp_offset = 0; int jump_offset = 0; #define CODE_LVAR l+code_disp_offset +#define CODE_CALLER_ARG (l-ARG_LVAR_OFFSET)+arg_offset1 #define FUNC_LVAR l+disp_offset #define CALLER_ARG (l-ARG_LVAR_OFFSET)+arg_offset1 #define CALLEE_ARG l+arg_offset @@ -192,7 +193,10 @@ lvar8(int l) { if (fnptr->sc==CODE) { - printf("lo16(%d)(r30)\n",CODE_LVAR); + if (l>=ARG_LVAR_OFFSET) { /* caller's arguments */ + printf("lo16(%d)(r1)\n",CODE_CALLER_ARG); + } else + printf("lo16(%d)(r30)\n",CODE_LVAR); } else if (l<0) { /* local variable */ printf("lo16(%d+L_%d)(r30)\n",FUNC_LVAR,lvar_offset_label); } else if (l>=ARG_LVAR_OFFSET) { /* caller's arguments */ @@ -215,7 +219,10 @@ lvar16ha(int l) { if (fnptr->sc==CODE) { - printf("la r0,ha16(%d)(r30)\n",CODE_LVAR); + if (l>=ARG_LVAR_OFFSET) { /* caller's arguments */ + printf("la r0,ha16(%d)(r1)\n",CODE_CALLER_ARG); + } else + printf("la r0,ha16(%d)(r30)\n",CODE_LVAR); } else if (l<0) { /* local variable */ printf("la r0,ha16(%d+L_%d)(r30)\n",FUNC_LVAR,lvar_offset_label); } else if (l>=ARG_LVAR_OFFSET) { /* caller's arguments */ @@ -230,7 +237,10 @@ lvar16lo(int l) { if (fnptr->sc==CODE) { - printf("lo16(%d)(r0)\n",CODE_LVAR); + if (l>=ARG_LVAR_OFFSET) { /* caller's arguments */ + printf("lo16(%d)(r0)\n",CODE_CALLER_ARG); + } else + printf("lo16(%d)(r0)\n",CODE_LVAR); } else if (l<0) { /* local variable */ printf("lo16(%d+L_%d)(r0)\n",FUNC_LVAR,lvar_offset_label); } else if (l>=ARG_LVAR_OFFSET) { /* caller's arguments */