No sequence points in assignment

Norman Diamond diamond at csl.sony.co.jp
Mon Sep 18 14:12:19 AEST 1989


In article <1026 at m3.mfci.UUCP> karzes at mfci.UUCP (Tom Karzes) quotes:

>The second paragraph in section 3.3 says:
>    Between the previous and next sequence point an object shall have
>    its stored value modified at most once by the evaluation of an
>    expression.  Furthermore, the prior value shall be accessed only
>    to determine the value to be stored.

Even if the expression contains two assignments to the same object?
(As did the example which led to this thread.)  Even without the
optimizer turned on, the compiler is REQUIRED to notice and delete
all but one assignment to the same object?

(Uh, remember that other thread about whether two pointers are equal,
and it depends on whether they point to the same object, i.e. things
like ring numbers have to be masked out.)  Wow, a non-optimizing
compiler is going to have to do a lot of alias checking in order to
meet section 3.3.

--
-- 
Norman Diamond, Sony Corporation (diamond at ws.sony.junet)
  The above opinions are inherited by your machine's init process (pid 1),
  after being disowned and orphaned.  However, if you see this at Waterloo or
  Anterior, then their administrators must have approved of these opinions.



More information about the Comp.std.c mailing list