[fpc-devel] ARM compiler. Internal error 200312022

Yury Sidorov jura at ce.blagovest.com
Mon Jul 4 08:18:40 CEST 2005


From: "Florian Klaempfl" <F.Klaempfl at gmx.de>
>>>> var
>>>>   i: integer;
>>>> begin
>>>>   i:=PInteger(123)^;
>>>> end;
>>>>
>>>> Yury Sidorov.
>>>
>>>
>>> Fixed, hopefully I didn't destroy much because I didn't test the fix. 
>>> Maybe you can create a system.s before applying the patch and diff it 
>>> with a system.s from the new ppcarm.
>>
>>
>> system.s is generated properly as before.
>>
>> But fix is incorrect. The following strange code is generated for 
>> assignment:
>
> 123 is not aligned to a  32 bit boundary so byte moves are generated (try 
> with 120 instead), at least arm-linux require proper alignment. I agree 
> that the code is suboptimal and that it should generate 4 ld/st 
> instructions but the code is correct imo.
>
>>
>> ldr r0,.L9
>> mov r3,#123
>> mov r1,#4
>> .L10:
>> ldrb r2,[r3], #1
>> subs r1,r1,#1
>> strb r2,[r0], #1
>> bne .L10
>> ...
>> .L9:
>> .long U_P$TEST_I

Indeed, it must be processed in such way. With address 120 the code is much 
better :)

 mov r0,#120
 ldr r0,[r0]
 ldr r1,.L9
 str r0,[r1]

Yury. 






More information about the fpc-devel mailing list