From 8585817563025812174
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/10
Message-ID: <derobert-9FC87E.01591309012000@news.erols.com>#1/1
X-Deja-AN: 570489557
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>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com 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 947453350 mail2news:27005 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: 9 Jan 2000 06:59:30 GMT
Newsgroups: comp.std.c++

In article <3876254a.30903561@news.csrlink.net>, 
jpotter@falcon.lhup.edu (John Potter) wrote:


>could someone give an example of translation which would produce
>something other than expected?
>
>   (i1 = i2) += i3;

Well, on my PowerPC this would generate (unoptimized):
-- sequence point --
or i1,i2,i2
add i1,i1,i3
-- sequence point --

Which could legally be re-arranged:
add i1,i1,i3
or i1, i2, i2

Which could then be optimized:
or i1, i2, i2

Which means:
   i1 = i2;

As there are no sequencing points. This could concievably be done for 
scheduling purposes. I don't seem to be able to get my compile to do it 
(it does even weirder stuff...)

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




