This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Thumb optimization question
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Ivan Petrov <ivan_p at seculab dot ru>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 03 Jan 2006 13:05:10 +0000
- Subject: Re: Thumb optimization question
- References: <000c01c60a65$2353ffc0$6401a8c0@IVANMOB>
On Mon, 2005-12-26 at 21:41, Ivan Petrov wrote:
> I have one question. So... have small sample programm.
>
> [code]
> int bar( int );
>
> int foo( int a, int b )
> {
> return bar( a + b );
> }
> [/code]
>
> If I compille it with out -thumb parameter, i have very clean code.
>
> add r0, r1, r0
> bx lr
>
> But with -thumb parameter have unopimized code.
>
> add r1, r1, r0
> mov r0, r1
> bx lr
>
> All diff of it outrage on '*.27.combine' (key -da) optimization step. But I long time can't understad how it work.
> Can anybody help me with it?
It's because the register allocator is stupid.
R.