This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: m68k bootstrapping broken


Bernardo Innocenti <bernie@develer.com> writes:

> Andreas Schwab wrote:
>
>>>printf.c:2451: error: insn does not satisfy its constraints:
>>>(insn 1379 542 543 38 (nil) (set (reg:QI 8 %a0)
>>>        (mem:QI (plus:SI (reg/f:SI 14 %a6)
>>>                        (const_int -209 [0xffffff2f])) [0 mode S1 A8])) 37 {*m68k.md:1060} (nil)
>>>                            (nil))
>> This tries to move a QImode from memory to an address register.  m68k.md
>> has this pattern for movqi:
>> (define_expand "movqi"
>>   [(set (match_operand:QI 0 "nonimmediate_operand" "")
>>         (match_operand:QI 1 "general_src_operand" ""))]
>>   ""
>>   "")
>> (define_insn ""
>>   [(set (match_operand:QI 0 "nonimmediate_operand" "=d,*a,m")
>> 	(match_operand:QI 1 "general_src_operand" "dmSi*a,di*a,dmSi"))]
>>   "!TARGET_COLDFIRE"
>>   "* return output_move_qimode (operands);")
>
> You meant to quote the TARGET_COLDFIRE version?  The ICE happens
> with -m5200.

Ok, I thought it was the other way round, but the argument equally holds
for this case.  And the potential for the bug also exists for
!TARGET_COLDFIRE, IMHO.

>> And indeed this combination of operands is not allowed by the constraints.
>> Shouldn't the define_expand reject this in the first place, or is there
>> some other mechanism to tell the reload pass not to generate such an insn?
>
> Sorry, I think I don't fully understand how the code generation pass
> works.  In gccint, I read:
>
>    Every RTL insn emitted by a `define_expand' must match some
>    `define_insn' in the machine description.  Otherwise, the compiler will
>    crash when trying to generate code for the insn or trying to optimize
>    it.
>
> So it means that once you've defined the "movqi" pattern, you must
> provide enough insns to satisfy all possible combinations of operands.

But named patterns are special, and movM patterns are even more special:

     Second, these patterns are not used solely in the RTL generation
     pass.  Even the reload pass can generate move insns to copy values
     from stack slots into temporary registers.  When it does so, one
     of the operands is a hard register and the other is an operand
     that can need to be reloaded into a register.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]