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

--- Comment #4 from Theodoros Theodoridis <theodort at inf dot ethz.ch> ---
Oops, there was a bug in my reduction, here's the fixed code:

https://godbolt.org/z/shxffzs8E

void foo(void);
typedef unsigned short uint16_t;
static int b;
static int ****c;
static int *f = &b;
static int *****ad;
static char(a)(char g, char h) { return g + h; }
static char(d)(char g, char h) { return g * h; }
static void(e)(uint16_t g) {
    if (!(((g) >= 1) && ((g) <= 65459))) {
        __builtin_unreachable();
    }
}
int main() {
    b = 0;
    for (;; b = 1) {
        char i = d(126 | 1, 205);
        e(i);
        short j;
        int k = *f;
        j = -21;
        for (; j; j = a(j, 7)) e((j ^ k && *f) <= *f);
        if (b) break;
        ad = &c;
    }
    if (ad)
        ;
    else
        foo();
    ;
}



trunk -O2:

main:
        movl    $0, b(%rip)
        movl    $2, %esi
        xorl    %ecx, %ecx
        xorl    %r8d, %r8d
.L7:
        movl    $-21, %eax
.L2:
        testl   %ecx, %ecx
        je      .L26
        leal    7(%rax), %edx
        movsbw  %dl, %di
        testb   %dl, %dl
        je      .L6
.L5:
        movl    $8, %eax
        cmpb    $1, %dl
        je      .L2
        movl    %edi, %eax
        leal    7(%rax), %edx
        movsbw  %dl, %di
        testb   %dl, %dl
        jne     .L5
.L6:
        cmpl    $1, %esi
        je      .L27
.L12:
        movl    $1, %esi
        movl    $1, %ecx
        movl    $1, %r8d
        jmp     .L7
.L26:
        testb   $1, %al
        je      .L4
        leal    7(%rax), %edx
        movsbw  %dl, %ax
        testb   %dl, %dl
        je      .L6
.L4:
        leal    14(%rax), %edx
        movsbw  %dl, %ax
        testb   %dl, %dl
        jne     .L4
        cmpl    $1, %esi
        jne     .L12
.L27:
        testb   %r8b, %r8b
        je      .L28
        movq    $c, ad(%rip)
        movl    %ecx, b(%rip)
.L23:
        xorl    %eax, %eax
        ret
.L28:
        cmpq    $0, ad(%rip)
        jne     .L23
        pushq   %rax
        call    foo
        xorl    %eax, %eax
        popq    %rdx
        ret


13.2 -O2:

main:
        movq    $c, ad(%rip)
        xorl    %eax, %eax
        movl    $1, b(%rip)
        ret


the bisection remains the same: r14-2365-g2e406f0753e

Reply via email to