Could not split insn
Hans-Peter Nilsson
hp@bitrange.com
Tue Sep 14 02:02:00 GMT 2004
On Mon, 13 Sep 2004, Petar Penchev wrote:
>
> Hello all,
> I have define "iorsi3" instruction in my .md file as follows :
>
> (define_insn_and_split "iorsi3"
> [(set (match_operand:SI 0 "nonimmediate_nonstack_operand" "=b, o")
> (ior:SI (match_operand:SI 1 "nonimmediate_nonstack_operand" "%0, 0")
> (match_operand:SI 2 "general_operand" "boi, boi")))
> (clobber (match_scratch:HI 3 "=X, &r"))]
> ""
> "#"
> "reload_completed"
> [(const_int 0)]
> "split_logical(HImode, IOR, operands);
> DONE;"
> )
>
> Where constraint 'b' is general-purpose register, which supports SImode.
> I tried to compile newlib with optimization -O1 and I have got folowing
> message:
>
> ../../../../../newlib_src/newlib/libc/stdlib/mprec.c: In function
> `_lshift':
> ../../../../../newlib_src/newlib/libc/stdlib/mprec.c:515: error: could not
> split insn
> (insn 222 278 279 (parallel [
> (set (reg:SI 0 A)
> (ior:SI (reg:SI 0 A)
> (const_int 0 [0x0])))
> (clobber (scratch:HI))
> ]) 62 {iorsi3} (insn_list 96 (nil))
> (expr_list:REG_UNUSED (scratch:HI)
> (nil)))
> ../../../../../newlib_src/newlib/libc/stdlib/mprec.c:515: internal
> compiler error: in final_scan_insn, at final.c:2429
>
> Register A is accessible in SImode.
> But it seems to me that pattern should be matched by the split.
That depends entirely on the splitter code in split_logical(),
which you didn't show.
Besides, the constraint "o" seems wrong: it allows any
offsettable operand, which includes stack operands, supposedly
refused by nonimmediate_nonstack_operand. You must not allow
operands in a constraint that are disallowed by the predicate.
> Does anybody have met the same problem ?
<evil>
I suppose you mean generally, bugs in an initial port? You bet.
You *really* have to debug this on your own; sending port
snippets will not work. Luckily, all the source code is there.
</evil>
;-)
brgds, H-P
More information about the Gcc
mailing list