Hi, what does speak against folding SUBREGs on constants in fold_rtx?
CSE does refuse to propagate constants into subreg expressions probably because fold_rtx does not handle it - and in fact a subreg on a constant does not seem to be defined. I'm wondering why this is the case? What's the problem with simplifying subregs on constants? If there is a good reason not to fold things like: (subreg:DI (const_int 1 [0x1]) 0) What about simplifying? (and:DI (subreg:DI (const_int 1 [0x1]) 0) (const_int 63 [0x3f]))) May we take care of it in simplify_binary_operation perhaps? I ran into these problems when trying to fix the shift patterns in the S/390 back end: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00346.html I see a few performance regressions with it due to missed optimizations. Bye, -Andreas-