Index: libgcc/config/arm/ieee754-df.S =================================================================== --- libgcc/config/arm/ieee754-df.S (revision 262850) +++ libgcc/config/arm/ieee754-df.S (working copy) @@ -203,6 +203,7 @@ #endif @ Determine how to normalize the result. + @ if result is denormal i.e (exp)=0,then don't normalise the result, LSYM(Lad_p): cmp xh, #0x00100000 bcc LSYM(Lad_a) @@ -235,6 +236,8 @@ @ Result must be shifted left and exponent adjusted. LSYM(Lad_a): + cmp r4,#0x0 + beq LSYM(Lad_e) movs ip, ip, lsl #1 adcs xl, xl, xl adc xh, xh, xh Index: gcc/testsuite/gcc.target/arm/pr86512.c =================================================================== --- gcc/testsuite/gcc.target/arm/pr86512.c (nonexistent) +++ gcc/testsuite/gcc.target/arm/pr86512.c (working copy) @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-options "-O0 -msoft-float" } */ + +#include +#include + +typedef union +{ + double d; + uint64_t i; +} u; + +int main() +{ + u smallestPositiveNormal, smallesPositiveSubnormal, expectedResult, result; + + smallesPositiveSubnormal.i = 1; + + smallestPositiveNormal.i = 0x0010000000000000; + expectedResult.i = 0x000fffffffffffff; + result.d = smallestPositiveNormal.d - smallesPositiveSubnormal.d; + + if (result.i != expectedResult.i) + abort(); + + return 0; +} +