This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Full comparison in 'cbranchsi4' leads to error in gcc 4.0
- From: Sami Khawam <S dot Khawam at ee dot ed dot ac dot uk>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 09 May 2005 16:08:36 +0100
- Subject: Full comparison in 'cbranchsi4' leads to error in gcc 4.0
Hi,
I am porting gcc (version 4.0) to a CPU supporting conditional jumps, which does
not have a CC register. I have combined the comparision and jump operation in
the definition of "cbranchsi4" as show at the end of this message.
This works fine on gcc 3.4, however on gcc 4.0 it creates an error during
optimization. According to my investigation, the error occurs when there is a
division by a constant power of 2 which needs to be transformed into shifting.
The error generated is:
internal compiler error: in emit_cmp_and_jump_insn_1, at optabs.c:3599
The definition of cbranchsi4 in the machine-description:
(define_insn "cbranchsi4"
[(set (pc) (if_then_else
(match_operator 0 "comparison_operator"
[(match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "nonmemory_operand" "r")])
(label_ref (match_operand 3 "" ""))
(pc)))]
""
"c%C0jump %1 %2 %3"
[(set_attr "type" "branch")
(set_attr "length" "1")]
)
Regards,
Sami Khawam
The University of Edinburgh
http://www.see.ed.ac.uk/~sxk