https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277783

--- Comment #2 from Steve Kargl <ka...@freebsd.org> ---
So, I don't loose a reduced version of the code:

#include <math.h>
#include <stdio.h>

int
main(void)
{
    volatile double x = 0x1p-500, y = 0x1p-550, z = 0x1p-1000;
    double a, b, c, r;

    a = x-y;
    b = x+y;
    c = -z;
    r = fma(a, b, c);
    /*
     * Should print -0 instead of +0.
     */
    printf("fma(%+a, %+a, %+a) = %+g\n", a, b, c, r);

    return 0;
}

% cc -o z -O3 a.c -lm && ./z
fma(+0x1.ffffffffffff8p-501, +0x1.0000000000004p-500, -0x1p-1000) = +0

% cc -o z -O3 a.c -mfma -lm && ./z
fma(+0x1.ffffffffffff8p-501, +0x1.0000000000004p-500, -0x1p-1000) = -0

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to