PATCH RFC: My version of the lower-subreg patch

Rask Ingemann Lambertsen rask@sygehus.dk
Sat Dec 30 15:09:00 GMT 2006


On Fri, Dec 29, 2006 at 08:47:13PM -0800, Ian Lance Taylor wrote:
> Rask Ingemann Lambertsen <rask@sygehus.dk> writes:
> 
> >    So the change is rejected, which trips the assert. I solved it by
> > reordering the two movhi variants. Other targets might run into the same
> > issue.
> 
> Interesting issue.  I think most targets will handle this just by
> using alternatives, though I understand that won't work for you
> because of the additional CLOBBER.

   The CLOBBER version is only meant for use by a peephole2 pattern. This is
the first time - that I know of - it has been matched by an earlier pass.

   As it turns out, the i386 back end has similiar insn patterns in the same
order that I did:

(define_insn "*movsi_xor"
  [(set (match_operand:SI 0 "register_operand" "=r")
        (match_operand:SI 1 "const0_operand" "i"))
   (clobber (reg:CC FLAGS_REG))]
  "reload_completed && ...

(define_insn "*movsi_1"
  [(set (match_operand:SI 0 "nonimmediate_operand" "=...")
        (match_operand:SI 1 "general_operand" "...")
  "!(MEM_P (operands[0]) && MEM_P (operands[1]))"

   But here, the CLOBBERS versions (at 32-bits, there's also one for -1) are
guarded by reload_completed and subreg passes run before reload.

-- 
Rask Ingemann Lambertsen



More information about the Gcc-patches mailing list