This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Can't find a register in class `CREG' while reloading `asm'.


Compilation of the following function fails
with the message: 

 Can't find a register in class `CREG' while reloading
`asm'.

Any help is greatly appreciated.

main()
{
char *dst_ep, *src_ep;
int nbytes = 10;
 
    do                                                
                       \
    {                                                 
                       \
      asm volatile (/* Set the direction flag, so
copying goes backwards.  */  \                  
"std\n"                                               
    \
                   /* Copy bytes.  */                 
                       \
                   "rep\n"                            
                       \
                   "movsb\n"                          
                       \
                   /* Clear the dir flag.  Convention
says it should be 0. */ \
                   "cld" :                            
                       \
                   "=D" (dst_ep), "=S" (src_ep) :     
                       \
                   "0" (dst_ep - 1), "1" (src_ep - 1),
"c" (nbytes) :         \
                   "cx");                             
                       \
      dst_ep += 1;                                    
                       \
      src_ep += 1;                                    
                       \
    } while (0);
 
 
 
 
}
xx.c: In function `main':
xx.c:6: Can't find a register in class `CREG' while
reloading `asm'.

[root@localhost /tmp]# rpm -qa|grep gcc
gcc-2.96-81
gcc-g77-2.96-81
gcc-c++-2.96-81
[root@localhost /tmp]#

[root@localhost /tmp]# rpm -qa|grep kernel
kernel-2.4.2-2
kernel-doc-2.4.2-2
kernel-source-2.4.2-2
kernel-headers-2.4.2-2

[root@localhost /tmp]# uname -a
Linux localhost.localdomain 2.4.2-2 #1 Sun Apr 8
20:41:30 EDT 2001 i686 unknown


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]