This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimisation question
- From: Robert Dewar <dewar at adacore dot com>
- To: "Remy X.O. Martin" <vsxo at hotmail dot com>
- Cc: Joe Buck <Joe dot Buck at synopsys dot COM>, gcc at gcc dot gnu dot org
- Date: Wed, 02 Feb 2005 07:46:01 -0500
- Subject: Re: optimisation question
- References: <20050131152659.0dc92d6c@portia.local> <41FE6ADB.3070706@adacore.com> <20050131234317.GA4737@synopsys.com> <20050201182110.192883b1@portia.local>
Remy X.O. Martin wrote:
I think, though, that the construct a=b=c exists by the very nature that it *could* be more efficient than the split-up version. It is not particularly more readable, for instance.
Not at all. It is a useful language construct, consider
*a++ = *b++ = *c++
as an example where the vaiables are not simple, and this is much
clearer than having to figure out what to do in two separate
assignments.
Even a=b=c in general seems nicer than a=c; b=c; just from a readability
point of view.
Finally, this is not some special "multiple assignment" construct.
Assignment is allowed anywhere in any expression, and this is just
one special case of using this much more general and useful rule.