This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Porting GCC
- From: Gyle Yearsley <gyearsley at zilog dot com>
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Wed, 2 Jun 2004 09:48:55 -0700
- Subject: Porting GCC
> I have been working on a gcc cross-compiler for a new processor that I am
> designing. I am
> in the process of setting up the ABI. Currently I am having a problem with
> pushing arguments
> on the stack when calling a function. I have allocoated three registers to
> hold function arguments.
> When I use three or less arguments the code will compile properly. Once I
> exceed the three args gcc
> will abort. I hae traced this to the function instantiate_virtual_regs. I
> assume this is due to the push
> instruction not matching. The processor has a stack pointer with a push
> instruction. Below is the output
> from the -dr debug option and the push insn from the machine descritption
> file.
>
> (insn 15 13 16 (nil) (set (mem/f:SI (pre_dec:SI (reg/f:SI 16 sp)) [0 S4
> A8])
> (mem/f:SI (plus:SI (reg/f:SI 18 virtual-stack-vars)
> (const_int -20 [0xffffffec])) [0 e+0 S4 A32])) -1 (nil)
> (nil))
>
>
> (define_insn "pushsi"
> [(set:SI (mem:SI (pre_dec:SI (reg:SI 16)))
> (match_operand:SI 0 "general_operand" "r,m"))]
> ""
> "@
> push.q %0
> push.q %0"
> )
>
> Any help would be appreciated.
>
> Gyle Yearsley
> Principal Design Engineer
> gyearsley@zilog.com
>
>