This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How to handle address which contain SUBREG
- From: Andy H <hutchinsonandy at aim dot com>
- To: GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 25 Nov 2009 10:37:39 -0500
- Subject: How to handle address which contain SUBREG
I'm am fixing some reload bugs for AVR.
In a couple of situations an address is formed which included a SUBREG
expression.
I am not sure how I should be handling these. Initial attempts produce
sub-optimal code - and/or reload failures, so thought is a good idea to
get some advise!
Either
(Subreg (Rx,0))
or
PLUS ((Subreg (Rx,0)) 5)
If I reject subreg expression, the code produced is sub-optimal.(since
address is then calculated into register)
For the non-strict case I believe the address should be accepted as
legitimate - on the basis that a SUBREG of psuedo is just as valid as REG.
For the strict case (hard register) - I could either accept if the
simplified form is valid - or reject and then make Legitimize simplify
the SUBREG expression. (I guess I might also have to handle it in
legitimize_reload_address.)
What is the right way?