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-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 7921 invoked from network); 2 Nov 1999 20:19:55 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 2 Nov 1999 20:19:55 -0000 Received: from piglet.twiddle.net (root@piglet.twiddle.net [207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id PAA31913 for ; Tue, 2 Nov 1999 15:19:54 -0500 Received: (from rth@localhost) by piglet.twiddle.net (8.9.3/8.9.3) id MAA29795; Tue, 2 Nov 1999 12:19:47 -0800 Date: Tue, 2 Nov 1999 12:19:47 -0800 From: Richard Henderson To: Peter Rival Cc: axp-list@redhat.com Subject: Re: Assembly errors with lockmeter Message-ID: <19991102121947.A29750@twiddle.net> References: <381F3A59.B110991E@zk3.dec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <381F3A59.B110991E@zk3.dec.com>; from Peter Rival on Tue, Nov 02, 1999 at 07:24:09PM +0000 On Tue, Nov 02, 1999 at 07:24:09PM +0000, Peter Rival wrote: > " stl_c %1,6f\n" > "6:\n" Look close and think carefully. You shouldn't be storing to a label, but instead to %0. r~ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 19980 invoked from network); 2 Nov 1999 20:51:01 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 2 Nov 1999 20:51:01 -0000 Received: from mailext03.compaq.com (mailext03.compaq.com [207.18.199.41]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id PAA04338 for ; Tue, 2 Nov 1999 15:51:01 -0500 Received: from mailint02.im.hou.compaq.com (mailint02.compaq.com [207.18.199.35]) by mailext03.compaq.com (Postfix) with ESMTP id B7FB5151FBC; Tue, 2 Nov 1999 14:51:00 -0600 (CST) Received: by mailint02.im.hou.compaq.com (Postfix, from userid 12345) id CA17FBC4C4; Tue, 2 Nov 1999 14:50:53 -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 638AFB2A42; Tue, 2 Nov 1999 14:50:53 -0600 (CST) Received: from wavy.zk3.dec.com by quarry.zk3.dec.com (8.8.8/1.1.8.2/16Jan95-0946AM) id PAA0000021773; Tue, 2 Nov 1999 15:50:56 -0500 (EST) Received: from zk3.dec.com by wavy.zk3.dec.com (8.8.8/1.1.20.8/09Sep99-1228PM) id PAA0000957400; Tue, 2 Nov 1999 15:50:55 -0500 (EST) Sender: frival@wavy.zk3.dec.com Message-ID: <381F4C6B.E64E925D@zk3.dec.com> Date: Tue, 02 Nov 1999 20:41:15 +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: Richard Henderson Cc: axp-list@redhat.com Subject: Re: Assembly errors with lockmeter References: <381F3A59.B110991E@zk3.dec.com> <19991102121947.A29750@twiddle.net> Content-Type: multipart/alternative; boundary="------------327C2DC2E348E99F70685AF9" --------------327C2DC2E348E99F70685AF9 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Richard Henderson wrote: > On Tue, Nov 02, 1999 at 07:24:09PM +0000, Peter Rival wrote: > > " stl_c %1,6f\n" > > "6:\n" > > Look close and think carefully. > > You shouldn't be storing to a label, but instead to %0. > Oh my God, I'm a moron. I was reading from something I had scratched together earlier and the paper was at an angle and I combined the stl_c with the following beq and came up with junk. After feeling stupid (and grabbing more coffee) I fixed it up as shown but now I still get the second error: [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 lockmeter.c -o lockmeter.o {standard input}: Assembler messages: {standard input}:655: Internal error! Assertion failure in alpha_align at ./config/tc-alpha.c line 4518. Please report this bug. Where this is what we see: mov $2,$1 stl_c $2,0($16) 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 $L944: rpcc $1 Is this an "upgrade to GCC 2.95" thing, or is something else wrong? This is a "stock" RH6.1 installed system. - Pete --------------327C2DC2E348E99F70685AF9 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Richard Henderson wrote:

On Tue, Nov 02, 1999 at 07:24:09PM +0000, Peter Rival wrote:
>         "       stl_c %1,6f\n"
>         "6:\n"

Look close and think carefully.

You shouldn't be storing to a label, but instead to %0.
 

Oh my God, I'm a moron.  I was reading from something I had scratched together earlier and the paper was at an angle and I combined the stl_c with the following beq and came up with junk.

After feeling stupid (and grabbing more coffee) I fixed it up as shown but now I still get the second error:

[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 lockmeter.c -o lockmeter.o
{standard input}: Assembler messages:
{standard input}:655: Internal error!
Assertion failure in alpha_align at ./config/tc-alpha.c line 4518.
Please report this bug.

Where this is what we see:

        mov $2,$1
        stl_c $2,0($16)
        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
$L944:
        rpcc $1

Is this an "upgrade to GCC 2.95" thing, or is something else wrong?  This is a "stock" RH6.1 installed system.

 - Pete --------------327C2DC2E348E99F70685AF9-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 29871 invoked from network); 2 Nov 1999 20:57:11 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 2 Nov 1999 20:57:11 -0000 Received: from piglet.twiddle.net (root@piglet.twiddle.net [207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id PAA05299 for ; Tue, 2 Nov 1999 15:57:10 -0500 Received: (from rth@localhost) by piglet.twiddle.net (8.9.3/8.9.3) id MAA30574; Tue, 2 Nov 1999 12:57:08 -0800 Date: Tue, 2 Nov 1999 12:57:08 -0800 From: Richard Henderson To: Peter Rival Cc: axp-list@redhat.com Subject: Re: Assembly errors with lockmeter Message-ID: <19991102125708.A30513@twiddle.net> References: <381F3A59.B110991E@zk3.dec.com> <19991102121947.A29750@twiddle.net> <381F4C6B.E64E925D@zk3.dec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <381F4C6B.E64E925D@zk3.dec.com>; from Peter Rival on Tue, Nov 02, 1999 at 08:41:15PM +0000 On Tue, Nov 02, 1999 at 08:41:15PM +0000, Peter Rival wrote: > Is this an "upgrade to GCC 2.95" thing, or is something else wrong? It's an assembler bug of some sort. I can reproduce it from the fragment you sent. I'll look at it shortly. r~ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 10659 invoked from network); 2 Nov 1999 21:48:06 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 2 Nov 1999 21:48:06 -0000 Received: from mb07.swip.net (mb07.swip.net [193.12.122.211]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA10320 for ; Tue, 2 Nov 1999 16:48:05 -0500 Received: from pc1 (d212-151-89-110.swipnet.se [212.151.89.110]) by mb07.swip.net (8.8.8/8.8.8) with SMTP id WAA18599 for ; Tue, 2 Nov 1999 22:47:59 +0100 (MET) Message-ID: <011901bf257c$366319e0$0100a8c0@swip.net> From: "Jonas Gustavsson" To: References: <381F3A59.B110991E@zk3.dec.com> <19991102121947.A29750@twiddle.net> <381F4C6B.E64E925D@zk3.dec.com> <19991102125708.A30513@twiddle.net> Subject: Cross Platform IDE Date: Tue, 2 Nov 1999 22:49:58 +0100 Organization: n Factory MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 As we=B4re starting to move some of our alphas over to Linux/Tru64(from = NT) it would be realy nice to have a Cross Platform IDE(Intergrated = Development=20 Enviroment), and I suppose I=B4m not the only one. It would be especialy usefull if the IDE was based on either GCC or the = GEM=20 stuff from compaq. Any ideas?? later Jonas Gustavsson n Factory From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 177 invoked from network); 3 Nov 1999 21:32:26 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 3 Nov 1999 21:32:26 -0000 Received: from p4-117-2.mit.edu (mail@P4-117-2.MIT.EDU [18.53.1.62]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA32095 for ; Wed, 3 Nov 1999 16:32:26 -0500 Received: from localhost ([127.0.0.1] helo=mit.edu ident=hazelsct) by p4-117-2.mit.edu with esmtp (Exim 3.03 #1 (Debian)) id 11j80x-0000Bx-00 for ; Wed, 03 Nov 1999 16:32:19 -0500 Sender: hazelsct@mail.redhat.com Message-ID: <3820A9E1.102839B1@mit.edu> Date: Wed, 03 Nov 1999 21:32:17 +0000 From: Adam C Powell IV Organization: Massachvsetts Institvte of Technology X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.10 i686) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Cross Platform IDE References: <381F3A59.B110991E@zk3.dec.com> <19991102121947.A29750@twiddle.net> <381F4C6B.E64E925D@zk3.dec.com> <19991102125708.A30513@twiddle.net> <011901bf257c$366319e0$0100a8c0@swip.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Jonas Gustavsson wrote: > As we´re starting to move some of our alphas over to Linux/Tru64(from NT) > it would be realy nice to have a Cross Platform IDE(Intergrated Development > Enviroment), and I suppose I´m not the only one. > It would be especialy usefull if the IDE was based on either GCC or the GEM > stuff from compaq. > > Any ideas?? Hmm, there's Code Warrior, but that's only for Intel. Maybe Cygnus Code Fusion, but that's for Linux and there's no indication it runs on other (OS) platforms. On the other hand, combined with Cygwin libraries/tools, it should be possible to build Code Fusion for NT. I would think they would have thought of that and done it already. For that matter, using Cygwin it should be possible to compile kIDE (KDE) or glade (GNOME) on NT as well. That's all I can think of. FWIW, you really should not start a new thread on a list by replying to another message. For those of us with threaded email clients, it sticks your post in the middle of the other thread, so we never see it unless we open that thread, even if you use a new subject. Just retype the email address, or set an alias so you don't have to type the whole thing. -Adam P. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 10005 invoked from network); 4 Nov 1999 00:12:59 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 4 Nov 1999 00:12:59 -0000 Received: from mb04.swip.net (mb04.swip.net [193.12.122.208]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id TAA18403 for ; Wed, 3 Nov 1999 19:12:59 -0500 Received: from pc1 (d212-151-46-252.swipnet.se [212.151.46.252]) by mb04.swip.net (8.8.8/8.8.8) with SMTP id BAA14312 for ; Thu, 4 Nov 1999 01:12:56 +0100 (MET) Message-ID: <006c01bf2659$c3747f80$0100a8c0@swip.net> From: "Jonas Gustavsson" To: References: <381F3A59.B110991E@zk3.dec.com> <19991102121947.A29750@twiddle.net> <381F4C6B.E64E925D@zk3.dec.com> <19991102125708.A30513@twiddle.net> <011901bf257c$366319e0$0100a8c0@swip.net> <3820A9E1.102839B1@mit.edu> Subject: SV: Cross Platform IDE Date: Thu, 4 Nov 1999 01:00:37 +0100 Organization: n Factory MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 > Hmm, there's Code Warrior, but that's only for Intel. Maybe Cygnus = Code > Fusion, but that's for Linux and there's no indication it runs on = other (OS) > platforms. On the other hand, combined with Cygwin libraries/tools, = it should > be possible to build Code Fusion for NT. I would think they would = have thought > of that and done it already. >=20 Thanks for the tips :-) > For that matter, using Cygwin it should be possible to compile kIDE = (KDE) or > glade (GNOME) on NT as well. >=20 I=B4ll see what I can do about KDE and GNOME > That's all I can think of. >=20 > FWIW, you really should not start a new thread on a list by replying = to another > message. For those of us with threaded email clients, it sticks your = post in > the middle of the other thread, so we never see it unless we open that = thread, > even if you use a new subject. Just retype the email address, or set = an alias > so you don't have to type the whole thing. >=20 Sorry!! for the thread mess :-( Later Jonas Gustavsson n Factory From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 5576 invoked from network); 8 Nov 1999 00:47:14 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 8 Nov 1999 00:47:14 -0000 Received: from piglet.twiddle.net (root@piglet.twiddle.net [207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id TAA25819 for ; Sun, 7 Nov 1999 19:47:13 -0500 Received: (from rth@localhost) by piglet.twiddle.net (8.9.3/8.9.3) id QAA07640; Sun, 7 Nov 1999 16:47:13 -0800 Date: Sun, 7 Nov 1999 16:47:13 -0800 From: Richard Henderson To: frival@zk3.dec.com Cc: axp-list@redhat.com Subject: Re: Assembly errors with lockmeter Message-ID: <19991107164713.A7248@twiddle.net> References: <381F3A59.B110991E@zk3.dec.com> <19991102121947.A29750@twiddle.net> <381F4C6B.E64E925D@zk3.dec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <381F4C6B.E64E925D@zk3.dec.com>; from Peter Rival on Tue, Nov 02, 1999 at 08:41:15PM +0000 On Tue, Nov 02, 1999 at 08:41:15PM +0000, Peter Rival wrote: > mb > .section .text2,"ax" > 6: > .previous > addl $1,$31,$1 <-- Line 655 This fixes it. I do wonder what exactly you're doing with labels in sections with no code attached to them... r~ * config/tc-alpha.c (alpha_align): Check, don't assert, that the previous label was in the current section before playing with auto-alignment. Index: gas/config/tc-alpha.c =================================================================== RCS file: /cvs/binutils/binutils/gas/config/tc-alpha.c,v retrieving revision 1.6 diff -c -p -d -r1.6 tc-alpha.c *** tc-alpha.c 1999/10/18 22:29:14 1.6 --- tc-alpha.c 1999/11/08 00:42:40 *************** alpha_align (n, pfill, label, force) *** 4756,4769 **** alpha_current_align = n; ! if (label != NULL) { - assert (S_GET_SEGMENT (label) == now_seg); symbol_set_frag (label, frag_now); S_SET_VALUE (label, (valueT) frag_now_fix ()); } ! record_alignment(now_seg, n); /* ??? if alpha_flag_relax && force && elf, record the requested alignment in a reloc for the linker to see. */ --- 4756,4768 ---- alpha_current_align = n; ! if (label != NULL && S_GET_SEGMENT (label) == now_seg) { symbol_set_frag (label, frag_now); S_SET_VALUE (label, (valueT) frag_now_fix ()); } ! record_alignment (now_seg, n); /* ??? if alpha_flag_relax && force && elf, record the requested alignment in a reloc for the linker to see. */ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 6209 invoked from network); 8 Nov 1999 13:33:46 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 8 Nov 1999 13:33:46 -0000 Received: from mailext02.compaq.com (mailext02.compaq.com [207.18.199.33]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id IAA04108 for ; Mon, 8 Nov 1999 08:33:46 -0500 Received: from mailint12.im.hou.compaq.com (mailint12.compaq.com [207.18.199.190]) by mailext02.compaq.com (Postfix) with ESMTP id E7D319A96F for ; Mon, 8 Nov 1999 07:33:45 -0600 (CST) Received: by mailint12.im.hou.compaq.com (Postfix, from userid 12345) id 2F8784FB23; Mon, 8 Nov 1999 07:33:30 -0600 (CST) Received: from quarry.zk3.dec.com (bryquarry.zk3.dec.com [16.141.40.15]) by mailint12.im.hou.compaq.com (Postfix) with ESMTP id DF4F74C901 for ; Mon, 8 Nov 1999 07:33:29 -0600 (CST) Received: from wavy.zk3.dec.com by quarry.zk3.dec.com (8.8.8/1.1.8.2/16Jan95-0946AM) id IAA0000022275; Mon, 8 Nov 1999 08:33:45 -0500 (EST) Received: from zk3.dec.com by wavy.zk3.dec.com (8.8.8/1.1.20.8/09Sep99-1228PM) id IAA0000771426; Mon, 8 Nov 1999 08:33:44 -0500 (EST) Sender: frival@wavy.zk3.dec.com Message-ID: <3826D83F.7B73A97@zk3.dec.com> Date: Mon, 08 Nov 1999 09:03:46 -0500 From: Peter Rival X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-29 alpha) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Assembly errors with lockmeter References: <381F3A59.B110991E@zk3.dec.com> <19991102121947.A29750@twiddle.net> <381F4C6B.E64E925D@zk3.dec.com> <19991107164713.A7248@twiddle.net> Content-Type: multipart/alternative; boundary="------------7733C59F37D34C45AD4A4F5B" --------------7733C59F37D34C45AD4A4F5B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Richard Henderson wrote: > On Tue, Nov 02, 1999 at 08:41:15PM +0000, Peter Rival wrote: > > mb > > .section .text2,"ax" > > 6: > > .previous > > addl $1,$31,$1 <-- Line 655 > > This fixes it. I do wonder what exactly you're doing with > labels in sections with no code attached to them... > I wonder myself sometimes...;) Basically I was trying to do something like "try to grab the read lock once, and if you fail, bail out". I was just trying to modify read_lock to do something like that. I suppose it would have been better to write it more like this: static __inline__ int _read_try_lock_(void *lock) { long temp,result=0; __asm__ __volatile__( "1: ldl_l %1,%0\n" " blbs %1,6f\n" " subl %1,2,%1\n" " stl_c %1,%0\n" " beq %1,6f\n" " mb\n" ".section .text2,\"ax\"\n" "6: mov %1,%2\n" ".previous" : "=m" (__dummy_lock(lock)), "=&r" (temp), "=&r" (result) : "m" (__dummy_lock(lock)) ); return (result != 1); /* Was the lock grabbed? */ } But that looks kinda ugly. I really don't want to unconditionally copy lock into the result, as I've already set the result to zero. Hmmm...any assembly experts have a better take on it? BTW, which tree is this against - 2.95.2 or egcs 1.1.2? Thanks for looking into it! - Pete > > * config/tc-alpha.c (alpha_align): Check, don't assert, that > the previous label was in the current section before playing > with auto-alignment. > > Index: gas/config/tc-alpha.c > =================================================================== > RCS file: /cvs/binutils/binutils/gas/config/tc-alpha.c,v > retrieving revision 1.6 > diff -c -p -d -r1.6 tc-alpha.c > *** tc-alpha.c 1999/10/18 22:29:14 1.6 > --- tc-alpha.c 1999/11/08 00:42:40 > *************** alpha_align (n, pfill, label, force) > *** 4756,4769 **** > > alpha_current_align = n; > > ! if (label != NULL) > { > - assert (S_GET_SEGMENT (label) == now_seg); > symbol_set_frag (label, frag_now); > S_SET_VALUE (label, (valueT) frag_now_fix ()); > } > > ! record_alignment(now_seg, n); > > /* ??? if alpha_flag_relax && force && elf, record the requested alignment > in a reloc for the linker to see. */ > --- 4756,4768 ---- > > alpha_current_align = n; > > ! if (label != NULL && S_GET_SEGMENT (label) == now_seg) > { > symbol_set_frag (label, frag_now); > S_SET_VALUE (label, (valueT) frag_now_fix ()); > } > > ! record_alignment (now_seg, n); > > /* ??? if alpha_flag_relax && force && elf, record the requested alignment > in a reloc for the linker to see. */ > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com --------------7733C59F37D34C45AD4A4F5B Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Richard Henderson wrote:

On Tue, Nov 02, 1999 at 08:41:15PM +0000, Peter Rival wrote:
>         mb
> .section .text2,"ax"
> 6:
> .previous
>         addl $1,$31,$1    <-- Line 655

This fixes it.  I do wonder what exactly you're doing with
labels in sections with no code attached to them...
 

I wonder myself sometimes...;)  Basically I was trying to do something like "try to grab the read lock once, and if you fail, bail out".  I was just trying to modify read_lock to do something like that.  I suppose it would have been better to write it more like this:

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

But that looks kinda ugly.  I really don't want to unconditionally copy lock into the result, as I've already set the result to zero.  Hmmm...any assembly experts have a better take on it?  BTW, which tree is this against - 2.95.2 or egcs 1.1.2?  Thanks for looking into it!

 - Pete

 
        * config/tc-alpha.c (alpha_align): Check, don't assert, that
        the previous label was in the current section before playing
        with auto-alignment.

Index: gas/config/tc-alpha.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/tc-alpha.c,v
retrieving revision 1.6
diff -c -p -d -r1.6 tc-alpha.c
*** tc-alpha.c  1999/10/18 22:29:14     1.6
--- tc-alpha.c  1999/11/08 00:42:40
*************** alpha_align (n, pfill, label, force)
*** 4756,4769 ****

    alpha_current_align = n;

!   if (label != NULL)
      {
-       assert (S_GET_SEGMENT (label) == now_seg);
        symbol_set_frag (label, frag_now);
        S_SET_VALUE (label, (valueT) frag_now_fix ());
      }

!   record_alignment(now_seg, n);

    /* ??? if alpha_flag_relax && force && elf, record the requested alignment
       in a reloc for the linker to see.  */
--- 4756,4768 ----

    alpha_current_align = n;

!   if (label != NULL && S_GET_SEGMENT (label) == now_seg)
      {
        symbol_set_frag (label, frag_now);
        S_SET_VALUE (label, (valueT) frag_now_fix ());
      }

!   record_alignment (now_seg, n);

    /* ??? if alpha_flag_relax && force && elf, record the requested alignment
       in a reloc for the linker to see.  */

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

--------------7733C59F37D34C45AD4A4F5B-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 16829 invoked from network); 24 Nov 1999 05:27:50 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 24 Nov 1999 05:27:50 -0000 Received: from piglet.twiddle.net (root@piglet.twiddle.net [207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id AAA04426 for ; Wed, 24 Nov 1999 00:27:50 -0500 Received: (from rth@localhost) by piglet.twiddle.net (8.9.3/8.9.3) id VAA13285 for axp-list@redhat.com; Tue, 23 Nov 1999 21:27:49 -0800 Date: Tue, 23 Nov 1999 21:27:49 -0800 From: Richard Henderson To: axp-list@redhat.com Subject: Re: Assembly errors with lockmeter Message-ID: <19991123212749.A13282@twiddle.net> References: <381F3A59.B110991E@zk3.dec.com> <19991102121947.A29750@twiddle.net> <381F4C6B.E64E925D@zk3.dec.com> <19991107164713.A7248@twiddle.net> <3826D83F.7B73A97@zk3.dec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <3826D83F.7B73A97@zk3.dec.com>; from Peter Rival on Mon, Nov 08, 1999 at 09:03:46AM -0500 On Mon, Nov 08, 1999 at 09:03:46AM -0500, Peter Rival wrote: > I wonder myself sometimes...;) Basically I was trying to do something > like "try to grab the read lock once, and if you fail, bail out". I > was just trying to modify read_lock to do something like that. I > suppose it would have been better to write it more like this: > > static __inline__ int _read_try_lock_(void *lock) > { > long temp,result=0; > __asm__ __volatile__( > "1: ldl_l %1,%0\n" > " blbs %1,6f\n" > " subl %1,2,%1\n" > " stl_c %1,%0\n" > " beq %1,6f\n" > " mb\n" > ".section .text2,\"ax\"\n" > "6: mov %1,%2\n" > ".previous" > : "=m" (__dummy_lock(lock)), "=&r" (temp), "=&r" (result) > : "m" (__dummy_lock(lock)) You _do_ realize that you're _still_ missing the branch back to label 1b? > But that looks kinda ugly. I really don't want to unconditionally > copy lock into the result, as I've already set the result to zero. What you have still doesn't make sense to me. I don't know what you're after. r~