https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63818

--- Comment #3 from Blaine Bell <blaine at blainebell dot org> ---
thanks for the quick response, much appreciated.

To be honest, I really don't understand this post/FAQ.  Looking at these
examples, I do not see any ambiguity.  This problem seems to be the compiler
implementation, and not defining the operator priority or sequence of commands,
even though it seems straight forward *if* the language is executed
left-to-right.

For example:

i++ * i++   : simply multiply i by i+1, where the value of i is i+2 afterwards.

i = i++     : same as i++

a[i] = i++  : set a[i] to i, then increment i 

The real problem is that the logic of the ++ operator is suppose to increment
the actual variable values, but the compiler tries to optimize and increment
the temporary variable created by a function call instead.

I am not completely familiar with the language specifications, but would
appreciate more pointers if you have them.

Thanks again,

Blaine

Reply via email to