From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 24752 invoked from network); 2 Nov 1999 19:33:53 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 2 Nov 1999 19:33:53 -0000 Received: from mailext12.compaq.com (mailext12.compaq.com [207.18.199.188]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id OAA25386 for ; Tue, 2 Nov 1999 14:33:52 -0500 Received: from mailint02.im.hou.compaq.com (mailint02.compaq.com [207.18.199.35]) by mailext12.compaq.com (Postfix) with ESMTP id E43DF57B35; Tue, 2 Nov 1999 13:33:51 -0600 (CST) Received: by mailint02.im.hou.compaq.com (Postfix, from userid 12345) id 14988BC4C4; Tue, 2 Nov 1999 13:33:45 -0600 (CST) Received: from quarry.zk3.dec.com (bryquarry.zk3.dec.com [16.141.40.15]) by mailint02.im.hou.compaq.com (Postfix) with ESMTP id 9C60DB2A44; Tue, 2 Nov 1999 13:33:44 -0600 (CST) Received: from wavy.zk3.dec.com by quarry.zk3.dec.com (8.8.8/1.1.8.2/16Jan95-0946AM) id OAA0000003727; Tue, 2 Nov 1999 14:33:50 -0500 (EST) Received: from zk3.dec.com by wavy.zk3.dec.com (8.8.8/1.1.20.8/09Sep99-1228PM) id OAA0000954268; Tue, 2 Nov 1999 14:33:48 -0500 (EST) Sender: frival@wavy.zk3.dec.com Message-ID: <381F3A59.B110991E@zk3.dec.com> Date: Tue, 02 Nov 1999 19:24:09 +0000 From: Peter Rival X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20smp i586) X-Accept-Language: en MIME-Version: 1.0 To: rth@twiddle.net Cc: axp-list@redhat.com Subject: Assembly errors with lockmeter Content-Type: multipart/alternative; boundary="------------49485353BE7023C2548C0E5B" --------------49485353BE7023C2548C0E5B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Richard, I've now ported most of the lockmeter code that was written at SGI for the x86 platform over to alpha. My last stumbling block has been the rwlocks, as they had written some cute code that worked nicely on x86's rwlocks. I've tried to rewrite it in Alpha assembly, but am now tripping over this one and have no clue why it's doing this. This is done with "egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)". The code segment is below, it's basically supposed to try once to get the read lock so we can start a timer if it fails (to keep track of our mean and total lock wait times): static __inline__ int _read_try_lock_(volatile rwlock_t *lock) { long temp,result; __asm__ __volatile__( "1: ldl_l %1,%0\n" " blbs %1,6f\n" " subl %1,2,%1\n" " mov %1,%2\n" " stl_c %1,6f\n" " beq %1,6f\n" " mb\n" ".section .text2,\"ax\"\n" "6:\n" ".previous" : "=m" (__dummy_lock(lock)), "=&r" (temp), "=&r" (result) : "m" (__dummy_lock(lock)) ); return (result); /* Was the lock grabbed? */ } This is the error I get: [frival@av8r kernel]$ gcc -D__KERNEL__ -I/home/frival/lockwork/linux-2.3.22/include -Wall -Wstrict-prototypes -O2 -fno-strict-aliasing -D__SMP__ -pipe -mno-fp-regs -ffixed-8 -c -o lockmeter.o lockmeter.c {standard input}: Assembler messages: {standard input}:649: Error: macro requires $at register while noat in effect {standard input}:655: Internal error! Assertion failure in alpha_align at ./config/tc-alpha.c line 4518. Please report this bug. And finally, this is the final assembly code I get (with gcc -S): $_read_lock_..ng: subq $30,32,$30 stq $26,0($30) .prologue 1 bic $26,3,$26 stq $16,16($30) bis $26,1,$17 1: ldl_l $2,0($16) blbs $2,6f subl $2,2,$2 mov $2,$1 stl_c $2,6f <-- line 649 beq $2,6f mb .section .text2,"ax" 6: .previous addl $1,$31,$1 <-- line 655 beq $1,$L944 ldq $16,16($30) bis $31,$31,$18 bsr $26,$lstat_update..ng br $31,$L943 --------------49485353BE7023C2548C0E5B Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Richard,

    I've now ported most of the lockmeter code that was written at SGI for the x86 platform over to alpha.  My last stumbling block has been the rwlocks, as they had written some cute code that worked nicely on x86's rwlocks.  I've tried to rewrite it in Alpha assembly, but am now tripping over this one and have no clue why it's doing this.  This is done with "egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)".  The code segment is below, it's basically supposed to try once to get the read lock so we can start a timer if it fails (to keep track of our mean and total lock wait times):

static __inline__ int _read_try_lock_(volatile rwlock_t *lock)
{
        long temp,result;
        __asm__ __volatile__(
        "1:     ldl_l %1,%0\n"
        "       blbs %1,6f\n"
        "       subl %1,2,%1\n"
        "       mov %1,%2\n"
        "       stl_c %1,6f\n"
        "       beq %1,6f\n"
        "       mb\n"
        ".section .text2,\"ax\"\n"
        "6:\n"
        ".previous"
        : "=m" (__dummy_lock(lock)), "=&r" (temp), "=&r" (result)
        : "m" (__dummy_lock(lock))
        );
        return (result);        /* Was the lock grabbed? */
}

This is the error I get:

[frival@av8r kernel]$ gcc -D__KERNEL__ -I/home/frival/lockwork/linux-2.3.22/include -Wall -Wstrict-prototypes -O2 -fno-strict-aliasing -D__SMP__ -pipe -mno-fp-regs -ffixed-8   -c -o lockmeter.o lockmeter.c
{standard input}: Assembler messages:
{standard input}:649: Error: macro requires $at register while noat in effect
{standard input}:655: Internal error!
Assertion failure in alpha_align at ./config/tc-alpha.c line 4518.
Please report this bug.

And finally, this is the final assembly code I get (with gcc -S):

<snip>
$_read_lock_..ng:
        subq $30,32,$30
        stq $26,0($30)
        .prologue 1
        bic $26,3,$26
        stq $16,16($30)
        bis $26,1,$17
        1:      ldl_l $2,0($16)
        blbs $2,6f
        subl $2,2,$2
        mov $2,$1
        stl_c $2,6f <-- line 649
        beq $2,6f
        mb
.section .text2,"ax"
6:
.previous
        addl $1,$31,$1 <-- line 655
        beq $1,$L944
        ldq $16,16($30)
        bis $31,$31,$18
        bsr $26,$lstat_update..ng
        br $31,$L943
<snip> --------------49485353BE7023C2548C0E5B--