OABI calling convention was broken since the addition of the hardfloat calling convention in commit 7f6095bfec82b178084b22b33941d4f06155e514. This commit fixes the breakage.
Unified · Split
| @@ -829,7 +829,7 @@ void gfunc_call(int nb_args) · 828 unmodified lines | |||
| 829 | --nb_args; | 829 | --nb_args; |
| 830 | } | 830 | } |
| 831 | 831 | ||
| 832 | vpushi(0); | 832 | vpushi(0), nb_args++; |
| 833 | vtop->type.t = VT_LLONG; | 833 | vtop->type.t = VT_LLONG; |
| 834 | args_size = 0; | 834 | args_size = 0; |
| 835 | #endif | 835 | #endif |
| @@ -845,7 +845,7 @@ void gfunc_call(int nb_args) · 9 unmodified lines | |||
| 845 | structures in the first zone are moved just after the SValue pointed by | 845 | structures in the first zone are moved just after the SValue pointed by |
| 846 | before_vfpreg_hfa. SValue's representing structures in the second zone are | 846 | before_vfpreg_hfa. SValue's representing structures in the second zone are |
| 847 | moved just after the SValue pointer by before_stack. */ | 847 | moved just after the SValue pointer by before_stack. */ |
| 848 | for(i = nb_args + 1 ; i-- ;) { | 848 | for(i = nb_args; i-- ;) { |
| 849 | int j, assigned_vfpreg = 0; | 849 | int j, assigned_vfpreg = 0; |
| 850 | size = type_size(&vtop[-i].type, &align); | 850 | size = type_size(&vtop[-i].type, &align); |
| 851 | switch(vtop[-i].type.t & VT_BTYPE) { | 851 | switch(vtop[-i].type.t & VT_BTYPE) { |
| @@ -920,9 +920,11 @@ void gfunc_call(int nb_args) · 68 unmodified lines | |||
| 920 | } | 920 | } |
| 921 | continue; | 921 | continue; |
| 922 | default: | 922 | default: |
| 923 | #ifdef TCC_ARM_EABI | ||
| 923 | if (!i) { | 924 | if (!i) { |
| 924 | break; | 925 | break; |
| 925 | } | 926 | } |
| 927 | #endif | ||
| 926 | if (ncrn < 4) { | 928 | if (ncrn < 4) { |
| 927 | int is_long = (vtop[-i].type.t & VT_BTYPE) == VT_LLONG; | 929 | int is_long = (vtop[-i].type.t & VT_BTYPE) == VT_LLONG; |
| 928 | 930 | ||
| @@ -953,7 +955,9 @@ void gfunc_call(int nb_args) · 24 unmodified lines | |||
| 953 | #endif | 955 | #endif |
| 954 | args_size += (size + 3) & -4; | 956 | args_size += (size + 3) & -4; |
| 955 | } | 957 | } |
| 956 | vtop--; | 958 | #ifdef TCC_ARM_EABI |
| 959 | vtop--, nb_args--; | ||
| 960 | #endif | ||
| 957 | args_size = keep = 0; | 961 | args_size = keep = 0; |
| 958 | for(i = 0;i < nb_args; i++) { | 962 | for(i = 0;i < nb_args; i++) { |
| 959 | vrotb(keep+1); | 963 | vrotb(keep+1); |