On Thu, May 17, 2012, Meador Inge <meadori ar codesourcery dot com> wrote: >> ;; This is *not* equal to zero because the upper >> ;; two bytes are undefined. >> (insn 14 13 15 2 (set (reg:SI 142) >> (subreg:SI (reg:QI 141) 0)) >> (expr_list:REG_EQUAL (const_int 0 [0]) >> (nil)))
Hmm, this is what doc/rtl.texi has to say about paradoxical subregs as rvalues: The high-order bits of rvalues are in the following circumstances: * subreg regs The upper bits are defined when SUBREG_PROMOTED_VAR_P is true. SUBREG_PROMOTED_UNSIGNED_P describes what the upper bits hold. The way I read this, suggests your patch allow simplify_subreg on paradoxical subregs if SUBREG_PROMOTED_VAR_P is true. But I'm not exactly an RTL expert, and I'm not 100% sure if this part of doc applies here. ;-) Ciao! Steven