This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimisation question
- From: Ian Lance Taylor <ian at airs dot com>
- To: "Remy X.O. Martin" <vsxo at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 01 Feb 2005 20:45:43 -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" <vsxo@hotmail.com> writes:
> 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.
No, it exists because in C "a = b" is an expression, not a statement.
For example, you can do
if (a = b) ...
or, more commonly,
for (a = b; ...
Since "a = b" is an expression, it follows that it is possible to do
"c = a = b", just as you can do "c = <any expression>".
Ian