Unified · Split
| @@ -3024,7 +3024,7 @@ static void gen_opif(int op) · 3023 unmodified lines | ||
| 3024 | 3024 | case '-': f1 -= f2; break; |
| 3025 | 3025 | case '*': f1 *= f2; break; |
| 3026 | 3026 | case '/': |
| 3027 | − if (f2 == 0.0) { | |
| 3027 | + if (f2 == (f1-f1) ) { | |
| 3028 | 3028 | union { float f; unsigned u; } x1, x2, y; |
| 3029 | 3029 | /* If not in initializer we need to potentially generate |
| 3030 | 3030 | FP exceptions at runtime, otherwise we want to fold. */ |
| @@ -3033,7 +3033,7 @@ static void gen_opif(int op) · 2 unmodified lines | ||
| 3033 | 3033 | /* the run-time result of 0.0/0.0 on x87, also of other compilers |
| 3034 | 3034 | when used to compile the f1 /= f2 below, would be -nan */ |
| 3035 | 3035 | x1.f = f1, x2.f = f2; |
| 3036 | − if (f1 == 0.0) | |
| 3036 | + if (f1 == (f1-f1) ) | |
| 3037 | 3037 | y.u = 0x7fc00000; /* nan */ |
| 3038 | 3038 | else |
| 3039 | 3039 | y.u = 0x7f800000; /* infinity */ |
| @@ -8102,7 +8102,7 @@ static void init_putv(init_params *p, CType *type, unsigned long c) · 5062 unmodified lines | ||
| 8102 | 8102 | else if (sizeof (long double) == sizeof (double)) |
| 8103 | 8103 | __asm__("fldl %1\nfstpt %0\n" : "=m" (*ptr) : "m" (vtop->c.ld)); |
| 8104 | 8104 | #endif |
| 8105 | − else if (vtop->c.ld == 0.0) | |
| 8105 | + else if (vtop->c.ld == (f1-f1) ) | |
| 8106 | 8106 | ; |
| 8107 | 8107 | else |
| 8108 | 8108 | #endif |