This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: reload question
- From: Ian Lance Taylor <ian at airs dot com>
- To: <tm_gccmail at kloo dot net>
- Cc: Miles Bader <miles at gnu dot org>, Bernd Schmidt <bernds_cb1 at t-online dot de>, gcc at gcc dot gnu dot org
- Date: 25 Mar 2005 07:43:24 -0500
- Subject: Re: reload question
- References: <Pine.LNX.4.21.0503250447460.25190-100000@mail.kloo.net>
<tm_gccmail@kloo.net> writes:
> It will generate a lot of redundant moves to/from the accumulator because
> the accumulator is exposed much too late.
>
> Consider the 3AC code:
>
> add i,j,k
> add k,l,m
>
> it will be broken down into:
>
> mov i,a
> add j,a
> mov a,k
> mov k,a
> add l,a
> mov a,m
>
> where the third and fourth instructions are basically redundant.
In the gcc context, the fourth instruction can be removed by the
reload CSE pass in postreload.c. Still, obviously the generated code
is going to be bad.
I agree that gcc is not well designed to cope with an accumulator
architecture. Reload can't cope.
Ian