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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-01-14
             Status|UNCONFIRMED                 |NEW

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Lukas Grätz from comment #7)
> (In reply to H.J. Lu from comment #4)
> > When I compiled __cxxabiv1::__cxa_throw, which is a noreturn function in
> > libstdc++-v3/libsupc++/eh_throw.cc not to save callee-saved registers,
> > most of C++ exception tests crashed.
> 
> Can you tell how you compiled it? Thanks in advance!

I have a patch to fix it. Please try users/hjl/pr113312/gcc-13 branch:

https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/pr113312/gcc-13?ref_type=heads

For your testcase, I got

        .globl  no_return_to_caller
        .type   no_return_to_caller, @function
no_return_to_caller:
.LFB0:
        .cfi_startproc
        subq    $24, %rsp
        .cfi_def_cfa_offset 32
        movl    $array+67108860, %eax
        xorl    %r13d, %r13d
        movq    %rax, 8(%rsp)
.L2:
        movl    $256, %ebp
        movq    8(%rsp), %r12
        movl    $256, %ebx
        subl    %r13d, %ebp
        .p2align 4,,10
        .p2align 3
.L6:
        movq    %r12, %r14
        movl    $256, %r15d
        .p2align 4,,10
        .p2align 3
.L3:
        movl    %r15d, %edx
        movl    %ebx, %esi
        movl    %ebp, %edi
        subl    $1, %r15d
        call    value
        subq    $4, %r14
        movl    %eax, 4(%r14)
        testl   %r15d, %r15d
        jne     .L3
        subq    $1024, %r12
        subl    $1, %ebx
        jne     .L6
        subq    $262144, 8(%rsp)
        addq    $1, %r13
        cmpq    $256, %r13
        jne     .L2
.L5:
        jmp     .L5
        .cfi_endproc
.LFE0:
        .size   no_return_to_caller, .-no_return_to_caller

Reply via email to