Unified · Split
| @@ -947,6 +947,8 @@ static int assign_regs(int nb_args, int float_abi, struct plan *plan, int *todo) · 946 unmodified lines | |||
| 947 | for(i = nb_args; i-- ;) { | 947 | for(i = nb_args; i-- ;) { |
| 948 | int j, start_vfpreg = 0; | 948 | int j, start_vfpreg = 0; |
| 949 | size = type_size(&vtop[-i].type, &align); | 949 | size = type_size(&vtop[-i].type, &align); |
| 950 | size = (size + 3) & ~3; | ||
| 951 | align = (align + 3) & ~3; | ||
| 950 | switch(vtop[-i].type.t & VT_BTYPE) { | 952 | switch(vtop[-i].type.t & VT_BTYPE) { |
| 951 | case VT_STRUCT: | 953 | case VT_STRUCT: |
| 952 | case VT_FLOAT: | 954 | 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 | |||
| 972 | break; | 974 | break; |
| 973 | } | 975 | } |
| 974 | } | 976 | } |
| 975 | ncrn = (ncrn + (align-1)/4) & -(align/4); | 977 | ncrn = (ncrn + (align-1)/4) & ~((align/4) - 1); |
| 976 | size = (size + 3) & -4; | ||
| 977 | if (ncrn + size/4 <= 4 || (ncrn < 4 && start_vfpreg != -1)) { | 978 | if (ncrn + size/4 <= 4 || (ncrn < 4 && start_vfpreg != -1)) { |
| 978 | /* The parameter is allocated both in core register and on stack. As | 979 | /* The parameter is allocated both in core register and on stack. As |
| 979 | * such, it can be of either class: it would either be the last of | 980 | * such, it can be of either class: it would either be the last of |