This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

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


>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.

PGP signature


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