The attached test case ICE's with the __builtin_unreachable() enabled.  With
the __builtin_unreachable() disabled, it compiles, but produces bad code:

        .file   "jumptest.c"
        .text
        .p2align 4,,15
.globl xyzzy
        .type   xyzzy, @function
xyzzy:
.LFB1:
        .cfi_startproc
#APP
# 10 "jumptest.c" 1
        # Either .L2 or .L3
        jmp .L2
# 0 "" 2
#NO_APP
        movl    $1, %eax      /*** XXX: Instruction skipped by jump ***/
.L2:
        rep
        ret
        .p2align 4,,10
        .p2align 3
.L3:
        xorl    %eax, %eax
        cmpl    $6, %edi
        setne   %al
        addl    $1, %eax
        ret
        .cfi_endproc
.LFE1:
        .size   xyzzy, .-xyzzy
        .ident  "GCC: (GNU) 4.5.0"
        .section        .note.GNU-stack,"",@progbits


-- 
           Summary: ICE with asm goto and __builtin_unreachable()
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hpa at zytor dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44071

Reply via email to