This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Problem with new port
- From: Alleged Judas <allegedjudas at yahoo dot co dot uk>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 6 Jan 2003 21:53:34 +0000 (GMT)
- Subject: Problem with new port
Hello,
I'm in the process of porting GCC to a new
architecture (of my own devising). I'm sort of
stumbling around in the dark most of the time,
although I have got to the stage where extremely basic
test functions (factorial, strcpy) will sort-of
compile.
Unfortunately I seem to have hit a problem which I'm
finding rather difficult to track down, and I'm
wondering if anyone can shed any light (the manual
isn't much help). Basically, I have the following test
functions:
---
int testfun(int a, int b, int c, int d, int e, int f,
int g)
{
return a+b+c+d+e+f+g;
}
int infun(int d)
{
return testfun(d, d+1, d+2, d+3, d+4, d+5, d+6);
}
---
Now, the first function seems to compile OK, but the
second gives this error:
---
jules@erwin:~/gcc-cvs/build$ gcc/xgcc -Bgcc -O2 -S
../foo.c -da
../foo.c: In function `infun':
../foo.c:58: error: insn does not satisfy its
constraints:
(insn 42 20 17 0 (nil) (set (reg:SI 8 r8)
(reg/f:SI 131 virtual-outgoing-args)) 1
{*movsi_simple} (nil)
(nil))
../foo.c:58: internal compiler error: in
reload_cse_simplify_operands, at reload1.c:8335
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html>
for instructions.
---
I don't think there should be any reference to
virtual-outgoing-args at this stage. I suspect the
problem might be somewhere in my target description
macros relating to function arguments (FUNCTION_ARG,
the CUMULATIVE_ARG stuff) or else I have missed out a
constraint I need in the movsi pattern (which seems
obvious, but I can't see anything) or else I need
reload_* patterns of some sort, which are currently
absent.
The movsi pattern is defined as:
---
(define_expand "movsi"
[(set (match_operand:SI 0 "nonimmediate_operand" "")
(match_operand:SI 1 "dop_not_illegal_const"
""))]
""
"{
if (GET_CODE(operands[0]) == MEM
&& !register_operand(operands[1], SImode)
&& !no_new_pseudos)
{
operands[1] = force_reg(SImode, operands[1]);
}
}")
(define_insn "*movsi_simple"
[(set (match_operand:SI 0 "nonimmediate_operand"
"=r,r,r,m,r,r")
(match_operand:SI 1 "general_operand"
"r,I,m,r,M,N"))]
""
"@
mov %0,%1
mov %0,#%d1
ldr.w %0,%1
str.w %1,%0
mvc.%e1 %0,#%d1
#")
(and some more...)
---
My architecture is "sort of" similar to the ARM in
that I pass the first four arguments (or first four
words of arguments) in registers, with the rest on the
stack. This appears to be vaguely the area my problem
is in, because function calls with less than four
arguments seem to work correctly (more or less).
Tell me anything else you need to know to be able to
help me!
TIA,
Jules
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com