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

--- Comment #17 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Rich Felker from comment #16)
> long syscall6(long n, long a, long b, long c, long d, long e, long f)
> {
>       register long r4 __asm__("$4") = a;
>       register long r5 __asm__("$5") = b;
>       register long r6 __asm__("$6") = c;
>       register long r7 __asm__("$7") = d;
>       register long r8 __asm__("$8") = e;
>       register long r9 __asm__("$9") = f;
>       register long r2 __asm__("$2");
>       __asm__ __volatile__ (
>               "subu $sp,$sp,32 ; sw $8,16($sp) ; sw $9,20($sp) ; "
>               "addu $2,$0,%4 ; syscall ;"
>               "addu $sp,$sp,32"
>               : "=&r"(r2), "+r"(r7), "+r"(r8), "+r"(r9)
>               : "ir"(n), "r"(r4), "r"(r5), "r"(r6)
>               : SYSCALL_CLOBBERLIST, "$10");
>       return r7 && r2>0 ? -r2 : r2;
> }

This looks like bad inline asm.  You seem to be using $2, $8, $9 and $sp
explicitly and not letting the compiler know you are using them.  I think you
want to change those to %0, %2 and %3 and adding one for $sp?   I could guess
the compiler might ignore your inputs/outputs that you specify if you don't
have any %<N> usages for them.

Reply via email to