From 7223127598623931354
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,7522e5259f7267d6
X-Google-Attributes: gidf78e5,public
From: Anthony DeRobertis <derobert@erols.com>
Subject: Re: x = y = z;  Undefined?
Date: 2000/01/17
Message-ID: <derobert-B813E8.01462317012000@news.erols.com>#1/1
X-Deja-AN: 573681430
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <MPG.12ddaa92533ae9679896a6@news.supernews.com> <t7so0bqea7.fsf@calumny.jyacc.com> <3876254a.30903561@news.csrlink.net> <derobert-9FC87E.01591309012000@news.erols.com> <3879ca08.3142429@news.csrlink.net> <derobert-8223E1.23372510012000@news.erols.com> <387b3c32.7816532@news.csrlink.net> <t7d7r8xyxm.fsf@calumny.jyacc.com> <387bc96e.43976982@news.csrlink.net> <t7so03w0xj.fsf@calumny.jyacc.com> <387dc78f.4864697@news.csrlink.net>
X-Authentication-Warning: backdraft.briar.org: smap set sender to <news@bob.news.rcn.net> using -f
Content-Type: text/plain; charset=ISO-8859-1
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 948103052 mail2news:1624 mail2news mail2news.demon.co.uk
Organization: -
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
User-Agent: MT-NewsWatcher/3.0 (PPC)
Mime-Version: 1.0
Nntp-Posting-Date: 17 Jan 2000 06:46:23 GMT
Newsgroups: comp.std.c++

In article <387dc78f.4864697@news.csrlink.net>, jpotter@falcon.lhup.edu 
(John Potter) wrote:

>On Thu, 13 Jan 2000 22:45:28 CST, Hyman Rosen <hymie@prolifics.com>
>wrote:
>
>: jpotter@falcon.lhup.edu (John Potter) writes:
>: > The only way that the mentioned reordering of the instructions is
>: > valid is if the compiler detects the undefined behavior.  Thus, the
>: > reordering is not valid.
>: 
>: You are presuming to omnisciently know the behavior of all compilers
>: and optimizers, on into the future?
>
>For the given two machine instructions, I think I am safe in that.  They
>both modify the same variable with the second using the result of the
>first.  Without knowing that there is no sequence point, the
>instructions may not be reversed.

Correct. But if a compiler were to actually use the sequence points to 
determine how it can schedule instructions, it would not notice that 
dependency.

There is no reason to expect a compiler to check for a store conflict 
like that inside of one sequence point.

-- 
Windows 95 (win-DOH-z), n. A thirty-two bit extension and graphical shell
to a sixteen bit patch to an eight bit operating system originally coded
for a four bit microprocessor which was used in a PC built by a formerly
two bit company that couldn't stand one bit of competition.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




