Comment 4 for bug 1804004

Revision history for this message
Michael Johnson (michaelpauljohnson) wrote : Re: [Bug 1804004] Re: ARM target generates unaligned STRD instruction

Hi Thomas,

Sorry I didn't see/understand the usage of

-mno-unaligned-access

for some reason I didn't think this would affect the optimiser.

Regards
Michael

> Hi Thomas
>
> This is the command line - the code is the same as the original bug
> report.
>
> "C:\Program Files (x86)\GNU Tools ARM Embedded\7
> 2018-q2-update\bin\arm-none-eabi-gcc" -c -fmessage-length=0 -I.
> -DDEBUG -D__THUMB -MD -MF "C:/Users/mpj/Documents/CrossWorks
> Projects/strd/strd THUMB Debug/main.d" -MQ "strd THUMB Debug/main.o"
> -g -std=gnu99 -Os -fomit-frame-pointer -ffunction-sections
> -fdata-sections main.c -o "strd THUMB Debug/main.o" -mcpu=cortex-m4
> -mlittle-endian -mfloat-abi=soft -mthumb
>
> section .text.x
> <x>
>     4B04        ldr r3, [pc, #16]
>     4A05        ldr r2, [pc, #20]
>     681B        ldr r3, [r3]
>     4905        ldr r1, [pc, #20]
>     E9C31201    strd r1, r2, [r3, #4]
>     2208        movs r2, #8
>     819A        strh r2, [r3, #12]
>     4770        bx lr
>     BF00        nop
>     00000000    .word 0x00000000
>     FFFD0000    .word 0xFFFD0000
>     00100008    .word 0x00100008
>
> Regards
> Michael
>> Hi Michael,
>>
>> I cannot seem to reproduce this issue:
>>
>> %
>> 7-2018Q2/linux/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc
>> -S -Os -mcpu=cortex-m4 -mno-unaligned-access strd.c -o - | sed -n
>> '/^x:/,/.L3:/p'
>> x:
>>          @ args = 0, pretend = 0, frame = 0
>>          @ frame_needed = 0, uses_anonymous_args = 0
>>          @ link register save eliminated.
>>          ldr     r3, .L2
>>          ldr     r2, .L2+4
>>          ldr     r3, [r3]
>>          str     r2, [r3, #4]
>>          ldr     r2, .L2+8
>>          str     r2, [r3, #8]
>>          movs    r2, #8
>>          strh    r2, [r3, #12]   @ movhi
>>          bx      lr
>> .L3:
>>
>> Can you please provide more guidance on how to reproduce it?
>>
>> Best regards,
>>
>> Thomas
>>
>> ** Changed in: gcc-arm-embedded
>>         Status: New => Incomplete
>>
>