Re: Strange expl results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 26, 2020 at 9:21 PM Alex Markin via Gcc-help
<gcc-help@xxxxxxxxxxx> wrote:
>
> Hello.
>
> I don't know if it is a gcc or binutils problem. I have different results
> for `expl' function depending on the argument was variable or literal:
>
> long double c, r1, r2;
> r1 = expl(-1);
>
> c = -1;
> r2 = expl(c);
>
> In this example r1 and r2 differ in the lower bits. The entire example is
> here: https://godbolt.org/z/xqn4bd. The llvm does not have such a problem.

The reason is that the Intel-specific 80 bit long double format is
used. So the first 80 bits of r1 and r2 contain the value, and the
rest remains uninitialized. You could memset both to 0 first, then the
comparison would check out. I'm sure there is a good reason for sizeof
producing 16, not 10.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux