https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93681

--- Comment #1 from Alexander Cherepanov <ch3root at openwall dot com> ---
And instability of integers then easily taints surrounding code:

----------------------------------------------------------------------
#include <stdio.h>

__attribute__((noipa)) // imagine it in a separate TU
static int opaque(int i) { return i; }

int main()
{
    int z = opaque(0);
    int a = opaque(1) + 0x1p-60 == 1;

    printf("z = %d\n", z);
    opaque(a);
    if (z == a) {
        opaque(0);
        if (a)
            printf("z = %d\n", z);
    }
}
----------------------------------------------------------------------
$ gcc -std=gnu11 -pedantic -Wall -Wextra -m32 -march=i686 -O3 test.c && ./a.out
z = 0
z = 1
----------------------------------------------------------------------
gcc x86-64 version: gcc (GCC) 10.0.1 20200211 (experimental)
----------------------------------------------------------------------

clang bug -- https://bugs.llvm.org/show_bug.cgi?id=44873

Reply via email to