void
sys_futex0 (int *addr, int op, int val)
{
  register long int r0 __asm__ ("r0");
  register long int r3 __asm__ ("r3");
  register long int r4 __asm__ ("r4");
  register long int r5 __asm__ ("r5");
  register long int r6 __asm__ ("r6");

  r0 = 221;
  r3 = (long) addr;
  r4 = op;
  r5 = val;
  r6 = 0;

  __asm volatile ("sc"
    : "=r"(r0), "=r"(r3), "=r"(r4), "=r"(r5), "=r"(r6)
    : "r"(r0), "r"(r3), "r"(r4), "r"(r5), "r"(r6)
    : "r7", "r8", "r9", "r10", "r11", "r12",
      "cr0", "ctr", "memory");
}

Compile with "gcc -Os -S z.c" and we see

sys_futex0:
        li 0,221
        li 6,0
        nop
        nop
#APP
        sc
#NO_APP
        nop
        nop
        nop
        nop
        blr

I thought perhaps they were alignment, but they don't align, and they show
up with -Os.

-- 
           Summary: Hordes of nop instructions being emitted
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc*-linux


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

Reply via email to