site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On 30 Jun 2008, at 19:32, J. Aaron Pendergrass wrote: Jonas _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I was somewhat surprised that the "most convenient thing for the programmer" was something like "if the left hand of side of a compound assignment statement is a pointer dereference, then determine it's r-value first, then evaluate the right hand side (including any pre/post increments/decrements), perform the arithmetic for the compound assignment, then determine the l-value of the left hand side and perform the actual assignment otherwise evaluate the left-hand side to determine both its r-value and l-value, then evaluate the right hand side (including any pre/post increments/decremetns), perform the arithmetic for the compound assignment, then store the result in the previously computed l- value." If the standard for a programming language does not define a particular evaluation order, the compiler usually uses some notion of complexity to determine what to do first in order to minimize the register pressure, to minimize the number of instructions required, etc. (all of which can be processor dependent). Such optimizations are by no means defined in if-then choices like you write above, but using some kind of heuristics which have been chosen based on resulting in good code for a bunch of test cases. Invalid/ undefined code is not commonly considered when writing/evaluating such heuristics. This email sent to site_archiver@lists.apple.com
participants (1)
-
Jonas Maebe