missed the alias when replying back. ---------- Forwarded message ---------- From: Kalai Rajah N <kalairajah@xxxxxxxxx> Date: Mon, Jun 10, 2013 at 5:19 PM Subject: Re: Thumb inline assembly To: Ian Lance Taylor <iant@xxxxxxxxxx> If the clobber-list is removed, the errors are on r1,r2, r3 and the generated assembly code is ... .thumb_func .type check_reset_value, %function check_reset_value: @ args = 0, pretend = 0, frame = 16 @ frame_needed = 1, uses_anonymous_args = 0 @ link register save eliminated. push {r4, r7} sub sp, sp, #16 add r7, sp, #0 str r0, [r7, #12] str r1, [r7, #8] str r2, [r7, #4] ldr r1, [r7, #12] ldr r0, [r7, #8] movw r3, #49374 movt r3, 47789 movw r2, #49374 movt r2, 24589 ldr r4, [r7, #4] @ 24 "nvic_reg_read.c" 1 ldr r2, =8 /* number of register */ ldr r1, =r1 /* load the nvic_iser* register */ read_reg: sub r2, r2, #1 ldr r0, [r1] add r1, r1, #4 /* go to the next register */ cmp r0, r0 beq read_reg_ok ldr r3, =r3 str r3, [r4] /* update status flag */ read_reg_ok: cmp r2, #0 bne read_reg ldr r3, =r2 str r3, [r4] /* update status flag */ - here the push seems fine. On Mon, Jun 10, 2013 at 5:13 PM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote: > On Mon, Jun 10, 2013 at 5:06 PM, Kalai Rajah N <kalairajah@xxxxxxxxx> wrote: >> Do you mean push is not supported or the specific parameters used by >> push in this code? >> >> But, from ARM's page, it seems the instruction is fine ... >> >> http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0283b/Babefbce.html > > That page says that in Thumb mode the push instruction only supports > the lo registers. > > Ian > >> On Mon, Jun 10, 2013 at 4:51 PM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote: >>> On Mon, Jun 10, 2013 at 4:19 PM, Kalai Rajah N <kalairajah@xxxxxxxxx> wrote: >>>> >>>> .thumb_func >>> >>> This is a Thumb function. >>> >>>> push {r4, r5, r6, r7, r8} >>> >>> As far as I know this is not a Thumb instruction. >>> >>> I don't know how this gets through the assembler. >>> >>> Ian