This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Possible bug in arm-linux-GCC 2.95.3 with inline asm
- To: Hanish Menon C <hanishkvc at fedtec dot com>
- Subject: Re: Possible bug in arm-linux-GCC 2.95.3 with inline asm
- From: Philip Blundell <philb at gnu dot org>
- Date: Wed, 08 Aug 2001 08:20:34 +0100
- Cc: gcc-bugs at gcc dot gnu dot org, crossgcc at sources dot redhat dot com, Russell King <rmk at arm dot linux dot org dot uk>
- References: <Pine.LNX.4.33.0108081225400.15562-100000@hanishkvc.fedtec.com>
>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