This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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....


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]