linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux 2.4.4-ac3, asm problem in asm-i386/rwsem.h using gcc 3.0 CVS
@ 2001-05-02 16:13 Christian Iseli
  2001-05-03 16:14 ` Mike Black
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Iseli @ 2001-05-02 16:13 UTC (permalink / raw)
  To: linux-kernel

Hi folks,

I currently fail to compile the 2.4.4-ac3 kernel using latest GCC 3.0 from CVS:
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes
 -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe
 -mpreferred-stack-boundary=2 -march=i686    -DEXPORT_SYMTAB -c sys.c
sys.c: In function `sys_gethostname':
/usr/src/linux/include/asm/rwsem.h:152:
 inconsistent operand constraints in an `asm'

Here is the code exerpt:
/*
 * unlock after reading
 */
static inline void __up_read(struct rw_semaphore *sem)
{
        __s32 tmp = -RWSEM_ACTIVE_READ_BIAS;
        __asm__ __volatile__(
                "# beginning __up_read\n\t"
LOCK_PREFIX     "  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
                "  js        2f\n\t" /* jump if the lock is being waited upon */
                "1:\n\t"
                ".section .text.lock,\"ax\"\n"
                "2:\n\t"
                "  decw      %%dx\n\t" /* do nothing if still outstanding active readers */
                "  jnz       1b\n\t"
                "  pushl     %%ecx\n\t"
                "  call      rwsem_wake\n\t"
                "  popl      %%ecx\n\t"
                "  jmp       1b\n"
                ".previous\n"
                "# ending __up_read\n"
                : "+m"(sem->count), "+d"(tmp)
                : "a"(sem)
                : "memory", "cc");
}

I'm afraid I know zilch about asm constraints...
Can anybody spot the trouble (and fix it :) ?

Thanks,
					Christian





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux 2.4.4-ac3, asm problem in asm-i386/rwsem.h using gcc 3.0 CVS
  2001-05-02 16:13 Linux 2.4.4-ac3, asm problem in asm-i386/rwsem.h using gcc 3.0 CVS Christian Iseli
@ 2001-05-03 16:14 ` Mike Black
  2001-05-04 13:16   ` Christian Iseli
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Black @ 2001-05-03 16:14 UTC (permalink / raw)
  To: linux-kernel, Christian Iseli

Looks like if you remove the "inline" from the function definition this
compiles OK.

________________________________________
Michael D. Black   Principal Engineer
mblack@csihq.com  321-676-2923,x203
http://www.csihq.com  Computer Science Innovations
http://www.csihq.com/~mike  My home page
FAX 321-676-2355
----- Original Message -----
From: "Christian Iseli" <chris@ludwig-alpha.unil.ch>
To: <linux-kernel@vger.kernel.org>
Sent: Wednesday, May 02, 2001 12:13 PM
Subject: Linux 2.4.4-ac3, asm problem in asm-i386/rwsem.h using gcc 3.0 CVS


Hi folks,

I currently fail to compile the 2.4.4-ac3 kernel using latest GCC 3.0 from
CVS:
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes
 -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe
 -mpreferred-stack-boundary=2 -march=i686    -DEXPORT_SYMTAB -c sys.c
sys.c: In function `sys_gethostname':
/usr/src/linux/include/asm/rwsem.h:152:
 inconsistent operand constraints in an `asm'

Here is the code exerpt:
/*
 * unlock after reading
 */
static inline void __up_read(struct rw_semaphore *sem)
{
        __s32 tmp = -RWSEM_ACTIVE_READ_BIAS;
        __asm__ __volatile__(
                "# beginning __up_read\n\t"
LOCK_PREFIX     "  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the
old value */
                "  js        2f\n\t" /* jump if the lock is being waited
upon */
                "1:\n\t"
                ".section .text.lock,\"ax\"\n"
                "2:\n\t"
                "  decw      %%dx\n\t" /* do nothing if still outstanding
active readers */
                "  jnz       1b\n\t"
                "  pushl     %%ecx\n\t"
                "  call      rwsem_wake\n\t"
                "  popl      %%ecx\n\t"
                "  jmp       1b\n"
                ".previous\n"
                "# ending __up_read\n"
                : "+m"(sem->count), "+d"(tmp)
                : "a"(sem)
                : "memory", "cc");
}

I'm afraid I know zilch about asm constraints...
Can anybody spot the trouble (and fix it :) ?

Thanks,
Christian




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux 2.4.4-ac3, asm problem in asm-i386/rwsem.h using gcc 3.0 CVS
  2001-05-03 16:14 ` Mike Black
@ 2001-05-04 13:16   ` Christian Iseli
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Iseli @ 2001-05-04 13:16 UTC (permalink / raw)
  To: Mike Black; +Cc: linux-kernel


mblack@csihq.com said:
> Looks like if you remove the "inline" from the function definition
> this compiles OK. 

Yup, looks like a compiler bug.  I submitted a bug report to GCC-gnats.

Cheers,
					Christian



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux 2.4.4-ac3, asm problem in asm-i386/rwsem.h using gcc 3.0 CVS
       [not found] <org0em8zhu.fsf@guarana.lsd.ic.unicamp.br>
@ 2001-05-03 12:11 ` Christian Iseli
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Iseli @ 2001-05-03 12:11 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc, linux-kernel

Hi,

aoliva@redhat.com said:
> I believe we'd need at least the source code of this function to be
> able to duplicate the problem with GCC.  Would you please submit a
> full bug report, following the guidelines at <URL:http://gcc.gnu.org/
> bugs.html>?  Thanks in advance, 

Ok, I filed a bug report to gcc-gnats, with pre-processed sources: `c/2728'

BTW, it is possible to compile sys.c with -O instead of -O2, and the problem 
is not triggered...

Cheers,
					Christian



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-05-04 13:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-02 16:13 Linux 2.4.4-ac3, asm problem in asm-i386/rwsem.h using gcc 3.0 CVS Christian Iseli
2001-05-03 16:14 ` Mike Black
2001-05-04 13:16   ` Christian Iseli
     [not found] <org0em8zhu.fsf@guarana.lsd.ic.unicamp.br>
2001-05-03 12:11 ` Christian Iseli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).