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

            Bug ID: 65283
           Summary: [SH] lds fpscr not put in delay slot
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org
            Target: sh*-*-*

Compiling this example:

float test (float a, float b)
{
  return a + b;
}

with -O2 -m4 -ml results in:
        sts     fpscr,r1
        mov.l   .L3,r2
        xor     r2,r1
        lds     r1,fpscr
        fmov    fr5,fr0
        fadd    fr4,fr0
        sts     fpscr,r1
        xor     r2,r1
        lds     r1,fpscr
        rts    
        nop

The problem is that the lds_fpscr insn is a multiple-set insn and thus the
delay-branch pass will not consider it.

Reply via email to