cvs egcs complains about asm statement on x86

Jeffrey A Law law@cygnus.com
Sun Nov 1 09:17:00 GMT 1998


  In message < 19981101052825.A1303@math.fu-berlin.de >you write:
  > The culprit is FD_ZERO on Linux 2.1.125, found in
  > 
  >   /usr/include/asm/posix_types.h
  > or
  >   /usr/src/linux/include/asm-i386/posix_types.h
  > 
  > This code demonstrates the problem:
  > 
  >   #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;
  > 
  >   void bla(void *fdsetp) {
  >   __asm__ __volatile__("cld ; rep ; stosl"
  > 	:"=m" (*(__kernel_fd_set *) (fdsetp))
  > 	:"a" (0), "c" (__FDSET_LONGS),
  > 	"D" ((__kernel_fd_set *) (fdsetp)) :"cx","di");
  >   }
  > 
  > I saved it as t.c and did this:
This asm is bogus.

It clobbers cx and di and also mentions them as inputs.  That is wrong.

jeff



More information about the Gcc-bugs mailing list