History

Fix OABI calling convention

OABI calling convention was broken since the addition of the hardfloat calling convention in commit 7f6095bfec82b178084b22b33941d4f06155e514. This commit fixes the breakage.

Thomas Preud'homme committed 13 years ago

Commit 8d902051 parent 05b02a51 file · +7 −3Browse files

Unified · Split

arm-gen.c+7−3
@@ -829,7 +829,7 @@ void gfunc_call(int nb_args) · 828 unmodified lines
829829 --nb_args;
830830 }
831831
832− vpushi(0);
832+ vpushi(0), nb_args++;
833833 vtop->type.t = VT_LLONG;
834834 args_size = 0;
835835 #endif
@@ -845,7 +845,7 @@ void gfunc_call(int nb_args) · 9 unmodified lines
845845 structures in the first zone are moved just after the SValue pointed by
846846 before_vfpreg_hfa. SValue's representing structures in the second zone are
847847 moved just after the SValue pointer by before_stack. */
848− for(i = nb_args + 1 ; i-- ;) {
848+ for(i = nb_args; i-- ;) {
849849 int j, assigned_vfpreg = 0;
850850 size = type_size(&vtop[-i].type, &align);
851851 switch(vtop[-i].type.t & VT_BTYPE) {
@@ -920,9 +920,11 @@ void gfunc_call(int nb_args) · 68 unmodified lines
920920 }
921921 continue;
922922 default:
923+#ifdef TCC_ARM_EABI
923924 if (!i) {
924925 break;
925926 }
927+#endif
926928 if (ncrn < 4) {
927929 int is_long = (vtop[-i].type.t & VT_BTYPE) == VT_LLONG;
928930
@@ -953,7 +955,9 @@ void gfunc_call(int nb_args) · 24 unmodified lines
953955 #endif
954956 args_size += (size + 3) & -4;
955957 }
956− vtop--;
958+#ifdef TCC_ARM_EABI
959+ vtop--, nb_args--;
960+#endif
957961 args_size = keep = 0;
958962 for(i = 0;i < nb_args; i++) {
959963 vrotb(keep+1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t