On 23/11/2016 11:26, Eric Botcazou wrote:
>> Does it really do that with a (set (reg1:QI)), as opposed to a
>> (set (strict_low_part (subreg:QI (reg1:DI)))?
>
> That's the question (note that REE runs after register allocation).
IIRC, strict_low_part is required even after register allocation, and
patterns such as this one in config/i386/i386.md seem to confirm it:
(define_split
[(set (match_operand:SWI248 0 "any_QIreg_operand")
(and:SWI248 (match_dup 0)
(const_int -256)))
(clobber (reg:CC FLAGS_REG))]
"(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& reload_completed"
[(set (strict_low_part (match_dup 1)) (const_int 0))]
"operands[1] = gen_lowpart (QImode, operands[0]);")
(Note the "&& reload_completed").
Thanks,
Paolo