i386.md bug + fix
Jim Wilson
wilson@cygnus.com
Thu May 7 20:06:00 GMT 1998
First of all some code taken from the output of compiling the
function makeUtf8Const in kaffe/kaffevm/string.s using just
the "-O -mcpu=pentium"---this code WORKS:
You should submit a testcase for this. We can't fix the bug without a
testcase.
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=&c")
(unspec:SI [(mem:BLK (match_operand:SI 1 "address_operand" "D"))
(match_operand:QI 2 "immediate_operand" "a")
(match_operand:SI 3 "immediate_operand" "i")] 0))
(clobber (match_dup 1))]
Where it goes wrong is, I beleive, that
operand 2 is never actually used within any RTL generated by the
define_expand.
Operand2 is clearly used by the UNSPEC rtl. Adding a second use inside a
USE rtl does not make any sense. I don't understand how that could be
in any way useful.
However, it is possible that changing the immediate_operand predicate to
a register_operand predicate did something useful. I don't understand
why this fixes the problem though. The real bug may be elsewhere, which
is why I would like to see a testcase.
I do see one obvious bug looking at this pattern. Operand 1 is an
input/output operand, but is missing the required + constraint.
It is possible that this bug may be causing part of the trouble that
you are seeing. I can't tell without a testcase though.
Jim
More information about the Gcc-bugs
mailing list