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

--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 60445
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60445&action=edit
A patch

[hjl@gnu-tgl-3 pr47253]$ cat y.c
void t(), f();

void
decide(bool ok)
{
  if (ok)
    t();
  else
    f();
}
[hjl@gnu-tgl-3 pr47253]$ make y.s
/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/ -O2 -S
y.c
[hjl@gnu-tgl-3 pr47253]$ cat y.s
        .file   "y.c"
        .text
        .p2align 4
        .globl  decide
        .type   decide, @function
decide:
.LFB0:
        .cfi_startproc
        testb   %dil, %dil
        je      f
        jmp     t
        .p2align 4,,10
        .p2align 3
.L2:
        jmp     f
        .cfi_endproc
.LFE0:
        .size   decide, .-decide
        .ident  "GCC: (GNU) 15.0.1 20250210 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-tgl-3 pr47253]$ 

But the unreachable basic block isn't removed.

Reply via email to