This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]