This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: INIT_CUMULATIVE_ARGS(): bug?
- From: Martin York <martin dot york at veritas dot com>
- To: 'Anders Ådland' <adland at stud dot ntnu dot no>, gcc at gcc dot gnu dot org
- Date: Tue, 25 Mar 2003 10:11:47 -0500
- Subject: RE: INIT_CUMULATIVE_ARGS(): bug?
If fnType is a type node representing a function
(ie TREE_CODE(fntype) == FUNCTION_TYPE)
Assuming you used 'build_function_type()' then:
TREE_CODE(fntype) is the type node representing the return type.
So the output below seems reasonable.
long long int: 64 bit
int 32 bit
-----Original Message-----
From: Anders Ådland [mailto:adland at stud dot ntnu dot no]
Sent: 25 March 2003 08:46
To: gcc at gcc dot gnu dot org
Subject: INIT_CUMULATIVE_ARGS(): bug?
Thanks for all the help you have given me so fare. I need some more...
I am using INIT_CUMULATIVE_ARGS(cum, fntype, libname, indirect) to
initialize the cum variable. The first register to use for passing
arguments depends on the size of the argument. A long long int is using
the register pair r11:r10 while an int is using r12. Is fntype
representing the type of the first argument? It looks like it is
representing the type of the return value:
In the function
long long int foo(int arg1, int arg2) { ... }
TREE_INT_CST_LOW(TYPE_SIZE(TREE_TYPE(fntype))) is equal to 64, but in
the function
int foo(int arg1, int arg2) { ... }
TREE_INT_CST_LOW(TYPE_SIZE(TREE_TYPE(fntype))) is equal to 32. Why?
Is this how it should be? I am using r12 as return register.
Anders