|[5 earlier articles]|
|Re: By value-result vs by reference email@example.com (1994-04-22)|
|Re: By value-result vs by reference firstname.lastname@example.org (1994-04-24)|
|Re: By value-result vs by reference email@example.com (1994-04-23)|
|Re: By value-result vs by reference firstname.lastname@example.org (1994-04-26)|
|Re: By value-result vs by reference Theo.Norvell@comlab.oxford.ac.uk (1994-04-26)|
|Re: By value-result vs by reference email@example.com (1994-04-28)|
|Re: By value-result vs by reference firstname.lastname@example.org (1994-04-29)|
|Re: By value-result vs by reference email@example.com (1994-04-29)|
|Re: By value-result vs by reference firstname.lastname@example.org (1994-05-01)|
|From:||email@example.com (Anton Ertl)|
|Organization:||Institut fuer Computersprachen, Technische Universitaet Wien|
|Date:||Fri, 29 Apr 1994 08:48:10 GMT|
firstname.lastname@example.org (Frederic Guerin) writes:
|> I would like to hear about call-by-value-result vs call-by-reference,
|> which one is better ?
|> Is there some good reason to prohibit call-by-value-result that I can't see,
|> or is it coincidental of these days ?
As others have pointed out, the reason for having or not having
value-result is the language specification. If the language specifies
reference parameters, you would need interprocedural alias analysis to
convert reference parameters to value-result parameters. In my experience,
however, even if the compiler can do interprocedural optimization, it's
impractical IMO (no separate compilation).
Someone suggested the following solution to the aliasing problem in this
forum: The compiler should produce two versions of every procedure, one
that assumes no aliasing, and one that is safe. If the compiler can
determine that the parameters are not aliased, it calls the no-aliasing
version. In this framework the no-aliasing version could also pass
appropriate parameters by value-result instead of by-reference.
If the language specifies value-result parameters, the benefits are even
greater than Frederic Guerin wrote. A lot of optimziation opportunities
are revealed, especially to compilers without alias analysis (the
compilers I have seen become quite stupid as soon as memory references are
involved). Hmm, given C++'s emphasis on efficiency and non-emphasis on
keeping the language lean, I wonder why they have not added value-result
parameters (or have they?-).
M. Anton Ertl
Return to the
Search the comp.compilers archives again.