http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50762

--- Comment #8 from Ulrich Weigand <uweigand at gcc dot gnu.org> 2011-11-09 
18:52:16 UTC ---
(In reply to comment #7)
> Redefining "j" constraint as "define_address_constraint" results in:

Yes, it needs to be define_address_constraint.

> pr50762.c:48:1: error: unrecognizable insn:
> (insn 29 28 30 3 (set (reg:DI 0 ax [77])
>         (zero_extend:DI (const_int 1 [0x1]))) pr50762.c:35 -1
>      (expr_list:REG_DEAD (reg/v:SI 59 [ p_60 ])
>         (nil)))
> pr50762.c:48:1: internal compiler error: in extract_insn, at recog.c:2137
> Please submit a full bug report,

That's odd.

> So, _why_ reload insists on pushing zero_extended constant to the register? 
> I'd
> expect that (const_int 1) is pushed into the register.
> 
> And finally, (zero_extend:DI (const_int 1 [0x1])) equals to (const_int 1
> [0x1]), so why this RTX isn't simplified on-the-fly?

The zero_extend is a fixed part of the insn pattern in question:

(define_insn "*lea_4_zext"
  [(set (match_operand:DI 0 "register_operand" "=r")
        (zero_extend:DI
          (match_operand:SI 1 "lea_address_operand" "p")))]

Reload only ever changes what is *inside* the operands.  It does not change the
fixed parts of the pattern (outside of operands).

What I would have expected to happen is for reload to load the (const_int 1)
into an SImode register, and then zero-extend that one ...

Not sure why that doesn't happen.  I'll have a look.

Reply via email to