optimization/5720: useless jump to call of nonreturning function

pb@nexus.co.uk pb@nexus.co.uk
Mon Feb 18 09:36:00 GMT 2002


>Number:         5720
>Category:       optimization
>Synopsis:       useless jump to call of nonreturning function
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 18 07:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Debian report #106866, submitted by <herbert@gondor.apana.org.au>
>Release:        3.0.3
>Organization:
>Environment:
i686-linux
>Description:
Compile the attached file with -O2.

The generated assembler includes:

        movl    intpending, %eax
        testl   %eax, %eax
        je      .L6
        jmp     .L11
        .p2align 2
.L9:
        orl     $1, %esi
        testl   %ebx, %ebx
[...]
.L11:
        call    doint

The "doint" function is marked with attribute((noreturn)) and there are no other branches to .L11.  The extra "jmp .L11" brings no benefit - the "call doint" could be put directly in its place.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list