|[12 earlier articles]|
|Re: C as assembly language firstname.lastname@example.org (felix) (2001-04-14)|
|Re: C as assembly language email@example.com.OZ.AU (2001-04-14)|
|Re: C as assembly language firstname.lastname@example.org (Randall Hyde) (2001-04-14)|
|Re: C as assembly language email@example.com (2001-04-15)|
|Re: C as assembly language firstname.lastname@example.org (Jim Granville) (2001-04-18)|
|Re: C as assembly language email@example.com (Joachim Durchholz) (2001-05-03)|
|Re: C as assembly language firstname.lastname@example.org (Joachim Durchholz) (2001-05-07)|
|Re: C as assembly language Hans_Boehm@hp.com (Hans Boehm) (2001-05-07)|
|Re: C as assembly language email@example.com (2001-05-13)|
|Re: C as assembly language firstname.lastname@example.org (David Thompson) (2001-05-15)|
|Re: C as assembly language email@example.com (2002-03-31)|
|From:||"Joachim Durchholz" <firstname.lastname@example.org>|
|Date:||7 May 2001 23:16:15 -0400|
|References:||01-03-006 01-03-046 01-03-130 01-04-027 01-04-052|
|Posted-Date:||07 May 2001 23:16:15 EDT|
Morrisett <email@example.com> wrote:
> "Joachim Durchholz" <firstname.lastname@example.org> wrote in message
> > 5) It cannot return multiple values in registers
> I don't understand this -- what's to prevent a (small) struct
> from being returned in registers?
Nothing. But putting the results into a struct comes with its own set of
1) The HLL compiler can't force the C compiler to do that. I'm pretty
sure that several brain-damaged C compiler can't do that.
2) What's more important: The HLL compiler has no way to decide how many
results should go into the result struct. If it puts too few results
into the struct, it wastes register space. If it puts too many results
into the struct, no results at all will be passed in registers.
3) What should the caller do with a struct from a result? You can't
assign it to another struct in C. You can't even take its address. All
you can do with it is (a) select a member from it (which essentially
means you're back at a single result) and (b) pass it to another
function (which will result in unlimited stack growth unless you're
*very* careful *and* have a C compiler that can do tail call
This is not an official statement from my employer.
Return to the
Search the comp.compilers archives again.