Alexandre Oliva <[EMAIL PROTECTED]> writes:

> On Dec 20, 2007, Ian Lance Taylor <[EMAIL PROTECTED]> wrote:
> 
> > It is technically feasible but problematic for other reasons.
> >     i = i * m + ((i / j) + k) / n;
> > On a two register machine like the x86 i will change several times
> > during that calculation.
> 
> No.  The register used to hold its initial value will.  Keep in mind
> the separation between user variables and implementation locations.
> The user variable 'i' is only supposed to change when assignment
> operation is performed, (even if only in a theoretical level), when
> the final value of the RHS is available and stored in the location
> then assigned to hold the value of variable 'i'.

OK, fair enough.

> Now, it is possible that the previous value of 'i' becomes unavailable
> while the expression is evaluated.  Then, in order to represent this
> correctly, we just have to note that 'i' is no longer available as
> soon as all locations holding its original value are clobbered, and
> that it's available again when its new location holds the assigned
> value.

Right, which will significantly increase debugging size as you add two
more notes around many lines.

Ian

Reply via email to