This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/72711] New: [SH] Missed delay slot with epilogue


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

            Bug ID: 72711
           Summary: [SH] Missed delay slot with epilogue
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org
  Target Milestone: ---
            Target: sh*-*-*

The following example shows that the delay slot pass stops looking for
candidates when it hits the beginning of the epilogue.

unsigned short bar (int);

unsigned short foo (int x)
{
  return bar (x) + 1;
}

Compiled with -O2 for SH:

_foo:
        mov.l   .L3,r0
        sts.l   pr,@-r15
        jsr     @r0
        nop
        add     #1,r0
        extu.w  r0,r0       <<< delay slot candidate
        lds.l   @r15+,pr
        rts
        nop                 <<< unused delay slot
.L4:
        .align 2
.L3:
        .long   _bar

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]