freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pooma-dev] Re: InlineEvaluator implementation question


From: Mark Mitchell
Subject: Re: [pooma-dev] Re: InlineEvaluator implementation question
Date: Mon, 16 Dec 2002 12:37:07 -0800



--On Monday, December 16, 2002 09:00:35 PM +0100 Richard Guenther <address@hidden> wrote:

On Mon, 16 Dec 2002, Mark Mitchell wrote:


> Hmm - as both, lhs and rhs are declared const, isnt this enough to tell
> the compiler? Or has the compiler to assume every function call can
> have a side-effect on any (but local) variable?

This is the classic "pointer aliasing" problem for compilers; the
modifications to lhs (via the write operatin in the loop) might,
from the compiler's point of view, change the rhs.  The copies allow
a good compiler to tell that this cannot happen.

Ah, of course. But only change the data (via the engines data pointer
which is aliasing), the lhs/rhs objects themselves usually will not alias
as they are of different types (in nearly all cases). So the copy doesnt
help the aliasing problem?

It's more complicated than that, and different compilers handle it
differently.  It's true that typed-based aliasing helps -- but it
doesn't always help enough.

That code is there because Jeffrey and I sat and stared at KCC output for
a week -- we know it helps for that compiler.

Unfortunately, I'm going to have a hard time reconstructing our full
analysis.

--
Mark Mitchell                address@hidden
CodeSourcery, LLC            http://www.codesourcery.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]