gcc-3.4.0 fails for ColdFire(does not satisfy constraints)
Peter Barada
peter@the-baradas.com
Tue Apr 27 14:57:00 GMT 2004
>> >Ah, now I see why reload was looking for ADDR_REG. Because
>> >addsi3_5200 has a ?a,a,rJK alternative, and -32 matches the J
>> >constraint. So I do think the problem is in that insn. It will tend
>> >to encourage the use of an address register in some cases for which a
>> >general register is appropriate.
>
>Here is the current insn for reference:
>
>(define_insn "*addsi3_5200"
> [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,r")
> (plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0")
> (match_operand:SI 2 "general_src_operand" "d,rJK,a,mrIKLs")))]
> "TARGET_COLDFIRE"
> "* return output_addsi3 (operands);")
>
>Alternative 0 is memory += data register. Alternative 1 is address
>register plus address register plus (register or signed 16 bit
>constant or any constant which moveq can't handle). Alternative 2 is
>(register or signed 16 bit constant or any constant which moveq can't
>handle) plus address register. Alternative 3 is any register +=
>(memory or any register or addq constant or any constant which moveq
>can't handle or subq constant or unknown constant).
I'm still wondering why replacing 's' with 'i' in the last alternative
makes the issue go away, and produces(in this particular case), good
code.
As for the peephole2 to use moveq to load the constant into a data
register, does this look right?
(define_peephole2
[(match_scratch:SI 2 "d")
(set (match_operand:SI 0 "register_or_memory_operand" "rm")
(plus:SI (match_dup 0)
(match_operand:SI 1 "immediate_operand" "K")))]
"!symbolic_operand (operands[1], SImode)"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))]
"")
--
Peter Barada
peter@the-baradas.com
More information about the Gcc
mailing list