This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]