I’m building a cross compiler that translates c code into assembly for this processor I’m working with. After several hours of work, I managed to get xgcc.exe to compile so that I can start getting it to spit out actual opcodes. However, I’ve hit a snag when trying to compile a simple void main code:
void main(){}
When I run this, I get the following internal compiler error
(call_ins 3 2 5 2 (call (mem SI ("__main") [flags 0x41]) [0 S4 A8])
(const_int 0 [0])) test.c:1 -1
(expr_list REG_EH_REGION (const_int 0 [0]) (nil)) (nil))
Internal compiler error: in extract_insn, at recog.c: 2109
I’ve literally copied a machine descriptor file from a working processor similar to mine (moxie) but it still produces the same error. The line that should be collaborating with this error is this:
(define_expand "call_value"
[(set (match_operand:SI 0 "memory_operand" "")
(call (match_operand:SI 1 "memory_operand" "")
(match_operand:SI 2 "memory_operand" "")))]
""
{
gcc_assert (MEM_P (operands[1]));
})"
But I’ve changed many parts of it and I’ve yet to be successful. Any ideas on what is causing this error?
After a bunch of hacking around, i resolved the issue with this:
In a nutshell, it wasn’t finding the call instruction because it didn’t match up.