Newsgroups: | comp.compilers |
From: | mfinney@inmind.com |
Keywords: | C++, optimize, design |
Organization: | In Mind, Inc. |
References: | 95-08-067 95-08-075 |
Date: | Thu, 10 Aug 1995 19:35:12 GMT |
I have been "lurking" in this debate for a week or so. I have to say
that I do NOT want order of evaluation specified except that all
operators in a full expression should be complete at the end of the
full expression. In the draft C++ standard that includes side
effects such as the destruction of temporaries.
I would go further, and say that point is the point where ++ or --
operations occur (semantically), so that statements like "x[i] = i++"
are well defined. However, I see NO benefit in tying down the order
of evaluation any tighter than that EXCEPT for floating point, and
the optimizers generally are not allowed to rearrange floating point
as much as they can rearrange fixed point.
Its true, that having to use the full expression technique to control
order of evaluation is very "low level" and even assembly-like. But
that is EXACTLY what you are doing when you are controlling the order
of evaluation. That doesn't differ from controlling exact register
usage in that aspect. When you want low-level control it is
appropriate to have to use low level code.
I think that the full expression definition is not just defined
because of the dusty deck problem, but it is, in fact, the CORRECT
definition.
Michael Lee Finney
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.