when long double is equal to double
Unified · Split
| @@ -776,6 +776,15 @@ static void gcall_or_jmp(int is_jmp) · 775 unmodified lines | ||
| 776 | 776 | } |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | +static int unalias_ldbl(int btype) | |
| 780 | +{ | |
| 781 | +#if LDOUBLE_SIZE == 8 | |
| 782 | + if (btype == VT_LDOUBLE) | |
| 783 | + btype = VT_DOUBLE; | |
| 784 | +#endif | |
| 785 | + return btype; | |
| 786 | +} | |
| 787 | + | |
| 779 | 788 | /* Return whether a structure is an homogeneous float aggregate or not. |
| 780 | 789 | The answer is true if all the elements of the structure are of the same |
| 781 | 790 | primitive float type and there is less than 4 elements. |
| @@ -788,9 +797,9 @@ static int is_hgen_float_aggr(CType *type) · 6 unmodified lines | ||
| 788 | 797 | int btype, nb_fields = 0; |
| 789 | 798 | |
| 790 | 799 | ref = type->ref->next; |
| 791 | − btype = ref->type.t & VT_BTYPE; | |
| 800 | + btype = unalias_ldbl(ref->type.t & VT_BTYPE); | |
| 792 | 801 | if (btype == VT_FLOAT || btype == VT_DOUBLE) { |
| 793 | − for(; ref && btype == (ref->type.t & VT_BTYPE); ref = ref->next, nb_fields++); | |
| 802 | + for(; ref && btype == unalias_ldbl(ref->type.t & VT_BTYPE); ref = ref->next, nb_fields++); | |
| 794 | 803 | return !ref && nb_fields <= 4; |
| 795 | 804 | } |
| 796 | 805 | } |