This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
egcs19990321 snapshot rejects linux v.2.2.4 kernel includes
- To: egcs at egcs dot cygnus dot com
- Subject: egcs19990321 snapshot rejects linux v.2.2.4 kernel includes
- From: Rimantas Plaipa <Rimantas dot Plaipa at gf dot vu dot lt>
- Date: Tue, 30 Mar 1999 12:59:00 +0200
Code which includes <asm/posix_types.h> (see the end of the post) fails
with egsc 19990321 snapshot release on linux 2.2.4 with the message:
"fixed or forbidden register 2 (cx) was spilled for class CREG".
It looks like the old well known problem but... (Yes I read the FAQ).
1. The kernel files are from the version 2.2.4 (not 2.0.x).
2. The problem affects building other programs not the linux kernel
(actualy I didn't try to compile kernel with this egsc version, I tried to
compile gdb).
3. The explanation in the FAQ doesn't help anyway. The assembler statement
is correct according to the FAQ - register cx is not "marked as clobbered".
--------------------------
/* this is an extract from <linux/posix_types.h>*/
#define __NFDBITS (8 * sizeof(unsigned long))
#define __FD_SETSIZE 1024
#define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS)
typedef struct {
unsigned long fds_bits [__FDSET_LONGS];
} __kernel_fd_set;
/* and this is from <asm/posix_types.h>*/
#define __FD_ZERO(fdsetp) \
do { \
int __d0, __d1; \
__asm__ __volatile__("cld ; rep ; stosl" \
:"=m" (*(__kernel_fd_set *) (fdsetp)), \
"=&c" (__d0), "=&D" (__d1) \
:"a" (0), "1" (__FDSET_LONGS), \
"2" ((__kernel_fd_set *) (fdsetp)) : "memory"); \
} while (0)
/* and now I'm trying to use it */
void t(){
__kernel_fd_set fd;
__FD_ZERO(&fd);
}
---------------------------------
Rimantas Plaipa,
Department of Biochemistry and Biophysics,
Vilnius University,
Ciurlionio 21/27, Vilnius 2009, Lithuania.
E-mail: rp010gf@voruta.vu.lt
Phone: (370-2)-650381
Fax: (370-2)-235049