public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/71923] return instruction emitted twice with branch target inbetween
       [not found] <bug-71923-4@http.gcc.gnu.org/bugzilla/>
@ 2023-07-18 14:29 ` javier.martinez.bugzilla at gmail dot com
  0 siblings, 0 replies; only message in thread
From: javier.martinez.bugzilla at gmail dot com @ 2023-07-18 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

Javier Martinez <javier.martinez.bugzilla at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |javier.martinez.bugzilla@gm
                   |                            |ail.com

--- Comment #2 from Javier Martinez <javier.martinez.bugzilla at gmail dot com> ---
Also reproducible with:

extern void s1(void);
extern void s2(void);

void foo(int i) {
    switch (i) {
        case 1:  return s1(); 
        case 2:  return s1();
        case 3:  return s2();
    }
}


On Trunk and with -O2 or higher:

foo(int):
  cmp edi, 2
  jg .L2
  test edi, edi
  jle .L7
  jmp s1             #tailcall
.LVL1:
  .p2align 4,,10
  .p2align 3
.L2:
  cmp edi, 3
  jne .L8
  jmp s2             #tailcall
.LVL2:
  .p2align 4,,10
  .p2align 3
.L7:
  ret                # <--- ret
  .p2align 4,,10
  .p2align 3
.L8:
  ret                # <--- ret

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-18 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-71923-4@http.gcc.gnu.org/bugzilla/>
2023-07-18 14:29 ` [Bug rtl-optimization/71923] return instruction emitted twice with branch target inbetween javier.martinez.bugzilla at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).