http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59549

            Bug ID: 59549
           Summary: [SH] __builtin_return_address causes push/pop of PR
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org
            Target: sh*-*-*

The following:

void* test (void)
{
  return __builtin_return_address (0);
}

compiled with -m4 -O2 results in:

        sts.l   pr,@-r15
        sts     pr,r0
        lds.l   @r15+,pr
        rts
        nop

The push and pop of PR is not necessary, as it's only used, but not modified.
It seems that calc_live_regs in sh.c is missing something.

Reply via email to