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

olegendo at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 27 17:01:00 GMT 2016


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


More information about the Gcc-bugs mailing list