This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Which optimizer should remove redundant subreg of sign_extension?
- From: Andrew Hutchinson <andrewhutchinson at cox dot net>
- To: GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 22 Dec 2009 13:16:27 -0500
- Subject: Which optimizer should remove redundant subreg of sign_extension?
I came across this RTL on AVR in combine dump (part of va-arg-9.c test)
(set (reg:QI 25 r25 [+1 ])
(subreg:QI (sign_extend:HI (reg:QI 49)) 1))
The sign extension is completely redundant - the upper part of register
is not used elsewhere
- but the RTL remains unchanged through all the optimizers and
sign_extension appears in final code.
Which RTL optimisation should be taking care of this? Propagation?
It would help me look in the right place to understand and perhaps fix
issue.
I suspect the presence of hard register is why it does not get removed.
(the hard register is the function return value)
Andy