This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: optimisation question
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Robert Dewar'" <dewar at adacore dot com>,"'Andreas Schwab'" <schwab at suse dot de>
- Cc: "'Remy X.O. Martin'" <vsxo at hotmail dot com>,"'Joe Buck'" <Joe dot Buck at synopsys dot COM>,<gcc at gcc dot gnu dot org>
- Date: Wed, 2 Feb 2005 14:37:48 -0000
- Subject: RE: optimisation question
> -----Original Message-----
> From: gcc-owner On Behalf Of Robert Dewar
> Sent: 02 February 2005 13:53
> Andreas Schwab wrote:
>
> >>Irrelevant, the assignments can be done in parallel
> regardless of which
> >>form they are written in. Sequence points create as-if
> sequencing, but
> >>a compiler can always reorder etc if it has no effect on the result.
> >
> >
> > Irrelevant, because semicolon is no different from comma in
> this point.
>
> Absolutely, and neither the semicolon nor the comma generates an
> obligation to do things in the sequence in which they appear
> in the code.
>
I think Andreas' point there is just that, if one accepts that comma and
semicolon are equivalent in this case, then one must also accept that the two
original examples
a = b, c = d, e = f;
and
a = b; c = d; e = f;
become formally identical, thereby showing that it's meaningless to suggest one
may be more optimal than the other.
cheers,
DaveK
--
Can't think of a witty .sigline today....