Activity log for bug #1667509

Date Who What changed Old value New value Message
2017-02-23 23:25:26 fcayci bug added bug
2017-02-23 23:25:26 fcayci attachment added Example program https://bugs.launchpad.net/bugs/1667509/+attachment/4825469/+files/temp.s
2017-02-23 23:52:08 fcayci description Hi I am working on writing assembly for a Cortex-M3 chip, and I just came across something interesting. When I try to compile `ldr r8, = #20` the assembler generates `cmp r0, #20` instruction. This happens for all the high registers. I don't know if this is an intended behavior or not, but it doesn't happen for higher numbers (> 255) and mov instruction. For example: ldr r8, = #1245 - works fine mov r8, #20 - works fine ldr r8, = #20 - do not work. I use the following to compile. arm-none-eabi-as.exe -mcpu=cortex-m3 -mthumb .\temp.s -o temp.elf Here is the part of the code: .thumb .syntax unified ... _start: ldr r5, = #1234 ldr r4, = #1234 ldr r8, = #20 mov r8, #20 ldr r3, = #1000 Here is what it generates: 00000008 <_start>: 8: f240 45d2 movw r5, #1234 ; 0x4d2 c: f240 44d2 movw r4, #1234 ; 0x4d2 10: 2814 cmp r0, #20 12: f04f 0814 mov.w r8, #20 16: f44f 737a mov.w r3, #1000 ; 0x3e8 Can you please advise? Thanks, Furkan Hi I am working on writing assembly for a Cortex-M3 chip, and I just came across something interesting. When I try to compile `ldr r8, = #20` the assembler generates `cmp r0, #20` instruction. This happens for all the high registers. I don't know if this is an intended behavior or not, but it doesn't happen for higher numbers (> 255) and mov instruction. For example: ldr r8, = #1245 - works fine mov r8, #20 - works fine ldr r8, = #20 - do not work. I use the following to compile. arm-none-eabi-as.exe -mcpu=cortex-m3 -mthumb .\temp.s -o temp.elf Here is the part of the code: .thumb .syntax unified ... _start:  ldr r5, = #1234  ldr r4, = #1234  ldr r8, = #20  mov r8, #20  ldr r3, = #1000 Here is what it generates: 00000008 <_start>:    8: f240 45d2 movw r5, #1234 ; 0x4d2    c: f240 44d2 movw r4, #1234 ; 0x4d2   10: 2814 cmp r0, #20   12: f04f 0814 mov.w r8, #20   16: f44f 737a mov.w r3, #1000 ; 0x3e8 Can you please advise? arm-none-eabi-as.exe --version GNU assembler (GNU Tools for ARM Embedded Processors) 2.26.2.20160923 Thanks, Furkan
2017-02-24 10:50:37 Thomas Preud'homme gcc-arm-embedded: status New Fix Released