public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* INIT_CUMULATIVE_ARGS(): bug?
@ 2003-03-25 14:18 Anders Ådland
  2003-03-25 17:52 ` Hans-Peter Nilsson
  0 siblings, 1 reply; 5+ messages in thread
From: Anders Ådland @ 2003-03-25 14:18 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: INIT_CUMULATIVE_ARGS(): bug?
@ 2003-03-25 15:32 Martin York
  0 siblings, 0 replies; 5+ messages in thread
From: Martin York @ 2003-03-25 15:32 UTC (permalink / raw)
  To: 'Anders Ådland', gcc



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@stud.ntnu.no]
Sent: 25 March 2003 08:46
To: gcc@gcc.gnu.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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-26 12:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-25 14:18 INIT_CUMULATIVE_ARGS(): bug? Anders Ådland
2003-03-25 17:52 ` Hans-Peter Nilsson
2003-03-26 12:46   ` INIT_CUMULATIVE_ARGS() Anders Ådland
2003-03-26 14:58     ` INIT_CUMULATIVE_ARGS() Hans-Peter Nilsson
2003-03-25 15:32 INIT_CUMULATIVE_ARGS(): bug? Martin York

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).