This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-3.4.0 fails for ColdFire(does not satisfy constraints)
>> Which doesn't allow for IKLs. This constraint *should* work, right?
>> Which ColdFire pattern are you seeing 'mrIKLs' on that you think should be
>> changed?
>
>addsi3_5200, which is the one which crashed reload in your last
>message.
Ah, I've been staring at RTL dumps too long. I was focusing on the
move, not the add :)
I changed the constraint from 's' to 'i':
(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,mrIKLi")))]
"TARGET_COLDFIRE"
"* return output_addsi3 (operands);")
and the problem has gone away. The resultant code that failed before looks like :
|(insn 1373 532 533 (set (reg:QI 0 %d0)
| (mem:QI (plus:SI (reg/f:SI 14 %a6)
| (const_int -112 [0xffffff90])) [0 S1 A8])) 33 {*m68k.md:826} (nil)
| (nil))
move.b -112(%a6),%d0 |, | 1373 *m68k.md:826/1
|(insn 533 1373 534 (set (reg:SI 0 %d0 [177])
| (plus:SI (reg:SI 0 %d0)
| (const_int -32 [0xffffffe0]))) 90 {*addsi3_5200} (nil)
| (nil))
add.l #-32,%d0 |, tmp177 | 533 *addsi3_5200/4
|(insn 534 533 536 (set (mem:QI (plus:SI (reg/f:SI 14 %a6)
| (const_int -112 [0xffffff90])) [0 S1 A8])
| (reg:QI 0 %d0 [orig:177+3 ] [177])) 33 {*m68k.md:826} (insn_list 533 (nil))
| (expr_list:REG_DEAD (reg:QI 0 %d0 [orig:177+3 ] [177])
| (nil)))
move.b %d0,-112(%a6) | tmp177, | 534 *m68k.md:826/2
Which is about as good as it can get on ColdFire since there is no
valid addqi3 pattern.
> >is actually worse. It might be better to not use the 's' constraint,
> >but to instead use a peephole2 which uses match_scratch, a technique
> >which was not available when the m68k backend was written.
Which backend would be a good place to find examples of this type of
peephole2 pattern? What is it that the pattern should do, create a
scratch register to stuff the constant? Are peephole2 patterns run
after reload?
--
Peter Barada
peter@the-baradas.com