Re: [cc65] Re: Optimization suggestion?

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2008-07-24 15:57:22
On Thu, Jul 24, 2008 at 03:49:56PM +0200, Christian Krüger wrote:
> Upps. I've read it at least 2 times in the past but didn't put that
> into this context. Anyhow: Wouldn't the optimization be usefull
> anyway?

It may be but it is more difficult than you assume. i++ is not just a
statement, but an expression that results in the value of i before it was
incremented. To determine if the optimization is possible, the compiler has to
check if the result of the expression is not used. It is much easier if the
programmer says explicitly "I don't care about the value before the increment"
by using ++i instead.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jul 24 15:57:32 2008

This archive was generated by hypermail 2.1.8 : 2008-07-24 15:57:34 CEST