[gccsdk] [GCCSDK commit] joty - r2459 - in trunk/gcc: gcc/libgcc unixlib/Docs unixlib/source/clib unixlib/source/clib/bits unixlib/source/clib/unixlib unixlib/source/gcccompat unixlib/source/netlib unixlib/source/pthread unixlib/source/scl unixlib/source/signal unixlib/source/stdlib unixlib/source/sys unixlib/source/unix

nick at sqrt.co.uk nick at sqrt.co.uk
Wed Dec 20 21:48:53 GMT 2006


> svnuser at riscos.info wrote:
>
>> Author: joty
>> Date: 2006-12-20 21:18:31 +0000 (Wed, 20 Dec 2006)
>> New Revision: 2459
>
>> Modified: trunk/gcc/unixlib/source/gcccompat/_galloca.s
>> ===================================================================
>> --- trunk/gcc/unixlib/source/gcccompat/_galloca.s	2006-12-18 08:51:21
>> UTC (rev 2458)
>> +++ trunk/gcc/unixlib/source/gcccompat/_galloca.s	2006-12-20 21:18:31
>> UTC (rev 2459)
>> @@ -14,6 +14,8 @@
>>  	; We must save any call-clobbered registers that are likely to be
>>  	; corrupted by the following function.  Otherwise we risk corrupting
>>  	; the return values from functions.
>> +	; FIXME: I *think* we can leave out a2-a3 because they are not used
>> +	; to return any values.
>>  	stmfd	sp!, {a1, a2, a3, a4, lr}
>>  	; If we pass the frame pointer in here, then we don't need to
>>  	; provide specific code.
>
> Don't forget that a2 gets clobbered if the function returns a 64bit
> value.

Furthermore, we may choose to break the APCS rules by hardcoding the 'BL'
instruction in gcc/config/arm.md.  This is the main reason I saved all the
registers.

The optimisation, if done correctly, can achieve a significant code
improvement in certain functions.

Regards,

Nick.




More information about the gcc mailing list