From: utzoo!watmath!watcgl!dmmartindale
Newsgroups: net.lang.c
Title: Re: Re: order of evaluation parse date s - (nf)
Article-I.D.: watcgl.236
Posted: Wed Mar  9 00:22:41 1983
Received: Wed Mar  9 02:46:32 1983
References: alice.1563

It isn't necessarily true that i == 5 after executing i = 4; i = i++;
Consider the following code sequence for i=i++ on a hypothetical machine:

	lda	i	# load i into accumulator
	aos	i	# do post-increment with Add One to Storage instruction
	sta	i	# and then store back into i

At the end, i == 4.
This is a perfectly reasonable code sequence to generate on a machine
that has no two-operand instructions, but does have an "aos" instruction.
Moral: Never try to second-guess the compiler and hardware when the result
is not defined by the semantics of the language.

	Dave Martindale