History

Fix fct param passing of struct with size < 4

Thomas Preud'homme committed 12 years ago

Commit 47608041 parent 9fc57301 file · +3 −2Browse files

Unified · Split

arm-gen.c+3−2
@@ -947,6 +947,8 @@ static int assign_regs(int nb_args, int float_abi, struct plan *plan, int *todo) · 946 unmodified lines
947947 for(i = nb_args; i-- ;) {
948948 int j, start_vfpreg = 0;
949949 size = type_size(&vtop[-i].type, &align);
950+ size = (size + 3) & ~3;
951+ align = (align + 3) & ~3;
950952 switch(vtop[-i].type.t & VT_BTYPE) {
951953 case VT_STRUCT:
952954 case VT_FLOAT:
@@ -972,8 +974,7 @@ static int assign_regs(int nb_args, int float_abi, struct plan *plan, int *todo) · 19 unmodified lines
972974 break;
973975 }
974976 }
975− ncrn = (ncrn + (align-1)/4) & -(align/4);
976− size = (size + 3) & -4;
977+ ncrn = (ncrn + (align-1)/4) & ~((align/4) - 1);
977978 if (ncrn + size/4 <= 4 || (ncrn < 4 && start_vfpreg != -1)) {
978979 /* The parameter is allocated both in core register and on stack. As
979980 * such, it can be of either class: it would either be the last of

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