This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Use of pointer casts in the interpreter


Kresten Krab Thorup <krab@gnu.org> writes:

> But maybe you can tell me this, is
> 
> 	*p++ = *--p;
> 
> equivalent to
> 
>         tmp = *--p;
>         *p++ = tmp;

You're right - they are not equivalent, as C makes no guarantee
as to the order of the side effects in the first expression.

Still, personally I would probably add the explicit variables
when needed at the call sites of the PUSH/POP macros, rather than in
the macros themselves.  (Better might be to use inline procedures,
though that does mean more work for the optimizer, as well as
really bad code when inlining is not performed.)
-- 
	--Per Bothner
bothner@pacbell.net  per@bothner.com   http://home.pacbell.net/bothner/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]