Possible bug in arm-linux-GCC 2.95.3 with inline asm

Philip Blundell philb@gnu.org
Wed Aug 8 00:20:00 GMT 2001


>Hi
>void debug_uart (unsigned int dbgchartoprint)
>{
>	__asm__ __volatile__
>	(
>	      " mov  r10, #0xd000
>                add  r10, r10, #4
>                mov  r10, r10, lsl #16
>                add  r10, r10, #0x4000
>	9:	ldr  r11, [r10, #0x018]
>		ands r11, r11, #0x020 @0x08
>		bne  9b
>		str %0, [r10] "
>            :
>	    : "r" (dbgchartoprint)
>            : "r10", "r11"
>	);    /* o/p, i/p and mangle list */
>}

You are clobbering the frame pointer. 

Why are you even using inline asm for this at all?  You can write that code in 
C just as well without any of these problems.  But, if you feel you must write 
in asm, let the compiler choose the registers for you or pick some more 
innocuous ones.

p.

-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.5 (GNU/Linux)
Comment: Exmh version 2.1.1 10/15/1999 (debian)

iD8DBQE7cOhCVTLPJe9CT30RAh1OAJ42shugI8Au0uu/L7cboeUtylBL8ACfb1vw
HE/La+9NBMIJMacwD0rMSpA=
=kSwP
-----END PGP SIGNATURE-----


More information about the crossgcc mailing list