Hello,

compiling serial_sa1100.c, i get a warning
 Warning: destination register same as write-back base      

This is generated by the macro "get_user" in "set_modem_info",
compiling into 

 2329 1bc4 0000B0E4             1:      ldrt    r0,[r0],#0
****  Warning:destination register same as write-back base

According to the ARM-ARM, using the same register for Rn and Rd is 
undefined for the post-index adressing only available for LDRT.

I do not know if this is relevant for any of the current armv-architectures,
but if so, the problem might be avoided by specifying the addr-operand 
as an early-clobberer by adding the "&"-constraint modifier for the
output-parameter "x" in include/asm-arm/proc-armv/uaccess.h


#define __get_user_asm_word(x,addr,err)                         \
        __asm__ __volatile__(                                   \
        "1:     ldrt    %1,[%2],#0\n"                           \
        "2:\n"                                                  \
        "       .section .fixup,\"ax\"\n"                       \
        "       .align  2\n"                                    \
        "3:     mvn     %0, %3\n"                               \
        "       mov     %1, #0\n"                               \
        "       b       2b\n"                                   \
        "       .previous\n"                                    \
        "       .section __ex_table,\"a\"\n"                    \
        "       .align  3\n"                                    \
        "       .long   1b, 3b\n"                               \
        "       .previous"                                      \
/* old: : "=r" (err), "=r" (x)  */                              \
/*new:*/: "=r" (err),"=&r" (x)                                  \
        : "r" (addr), "i" (EFAULT), "0" (err))


The compiler then generates this code :
0xc00c90d0 <set_modem_info+72>: ldrt    lr, [r0]

The same fix should also apply to __get_user_asm_half :
        : "=r" (err), "=&r" (x), "=&r" (__temp)                 \

and __get_user_asm_byte
        : "=r" (err), "=&r" (x)                                 \

However, maybe this problem only affected me because i use somewhat dated 
tools (gas 2.9.1 / egcs-2.91.60)

Regards, Klaus         
--
Mobotix AG
Klaus Borchers
Wingertsweilerhof 6
D-67724 Hoeringen
Germany

Tel: +49 (6302) 9223-88
Fax: +49 (6302) 9223-70
E-Mail: [EMAIL PROTECTED]

_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.

Reply via email to