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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-02-25
            Version|unknown                     |14.0
                 CC|                            |hjl.tools at gmail dot com
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
__attribute__((noreturn)) works in GCC 14:

[hjl@gnu-cfl-3 tmp]$ cat y.c
#include<setjmp.h>
#include<stdio.h>
//_Noreturn
__attribute__((noreturn))
void noret(unsigned A, unsigned B, unsigned C, unsigned D, unsigned E, jmp_buf
Jb){

    for(;A--;) puts("A");
    for(;B--;) puts("B");
    for(;C--;) puts("C");
    for(;D--;) puts("D");
    for(;E--;) puts("E");

    longjmp(Jb,1);
}
[hjl@gnu-cfl-3 tmp]$ /usr/gcc-14.0.1-x32/bin/gcc -S -O2 y.c
[hjl@gnu-cfl-3 tmp]$ cat y.s
        .file   "y.c"
        .text
        .section        .rodata.str1.1,"aMS",@progbits,1
.LC0:
        .string "A"
.LC1:
        .string "B"
.LC2:
        .string "C"
.LC3:
        .string "D"
.LC4:
        .string "E"
        .text
        .p2align 4
        .globl  noret
        .type   noret, @function
noret:
.LFB11:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        movl    %esi, %r15d
        movl    %edx, %r14d
        movl    %ecx, %r13d
        movl    %r8d, %ebp
        movq    %r9, %r12
        testl   %edi, %edi
        je      .L2
        leal    -1(%rdi), %ebx
        .p2align 4,,10
        .p2align 3
.L3:
        movl    $.LC0, %edi
        call    puts
        subl    $1, %ebx
        jnb     .L3
.L2:
        leal    -1(%r15), %ebx
        testl   %r15d, %r15d
        je      .L4
        .p2align 4,,10
        .p2align 3
.L5:
        movl    $.LC1, %edi
        call    puts
        subl    $1, %ebx
        jnb     .L5
.L4:
        leal    -1(%r14), %ebx
        testl   %r14d, %r14d
        je      .L6
        .p2align 4,,10
        .p2align 3
.L7:
        movl    $.LC2, %edi
        call    puts
        subl    $1, %ebx
        jnb     .L7
.L6:
        leal    -1(%r13), %ebx
        testl   %r13d, %r13d
        je      .L8
        .p2align 4,,10
        .p2align 3
.L9:
        movl    $.LC3, %edi
        call    puts
        subl    $1, %ebx
        jnb     .L9
.L8:
        leal    -1(%rbp), %ebx
        testl   %ebp, %ebp
        je      .L10
        .p2align 4,,10
        .p2align 3
.L11:
        movl    $.LC4, %edi
        call    puts
        subl    $1, %ebx
        jnb     .L11
.L10:
        movl    $1, %esi
        movq    %r12, %rdi
        call    longjmp
        .cfi_endproc
.LFE11:
        .size   noret, .-noret
        .ident  "GCC: (GNU) 14.0.1 20240223 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-3 tmp]$

Reply via email to