[Bug middle-end/94035] Wrong optimization: conditional equivalence vs. values with several representations
ch3root at openwall dot com
gcc-bugzilla@gcc.gnu.org
Thu Mar 5 21:34:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94035
--- Comment #3 from Alexander Cherepanov <ch3root at openwall dot com> ---
(In reply to joseph@codesourcery.com from comment #2)
> I think pseudo-denormals should be considered trap representations.
Cool!
What about IBM extended double (double-double)? All cases where (double)(hi +
lo) != hi are trap representations too?
But there is one case which you once mentioned as valid -- when the low part is
zero, this zero could be of any sign.
----------------------------------------------------------------------
#include <stdio.h>
__attribute__((noipa)) // imagine it in a separate TU
static long double opaque(long double d) { return d; }
int main()
{
long double x = -opaque(1);
unsigned char *px = (unsigned char *)&x;
if (x == -1)
printf("px[8] = %d\n", px[8]);
printf("px[8] = %d\n", px[8]);
}
----------------------------------------------------------------------
$ powerpc64-linux-gnu-gcc -std=c11 -pedantic -Wall -Wextra -O3 test.c &&
qemu-ppc64 /usr/powerpc-linux-gnu/lib64/ld64.so.1 --library-path
/usr/powerpc-linux-gnu/lib64 ./a.out
px[8] = 0
px[8] = 128
----------------------------------------------------------------------
gcc x86-64 version: powerpc64-linux-gnu-gcc (Debian 8.3.0-2) 8.3.0
----------------------------------------------------------------------
Here the low part of x is -0. , px[8] is a byte containing the sign bit of the
low part.
More information about the Gcc-bugs
mailing list