Aleksandar Donev wrote:
>
> Hi,
> [I think Kurt wrote?]
> > While TARGET could be added to A and B in
> > Calculation, that would be counterproductive, as it would force the
> > compiler to allow for overlap and thus kill the optimization you are
> trying
> > to promote.
>
> Thanks. Why exactly does TARGET do this? I though no mather what the
> attribute, other than POINTER, non-aliasing was guaranteed by the standard?
> I wasn't gonna put a TARGET there as the compiler need not know the actual
> arguments are accessed via a pointer, but the point is confusing.
>
I don't think TARGET needs to kill optimization. But, TARGET really
only makes sense if there are also POINTERs present and (obviously)
warns that the TARGETs might be altered in ways that the optimizer
can't easily figure out. Attaching a TARGET attribute unnecessarily
probably kills optimization just because the optimizer assumes
TARGETs are sort of volitile and doesn't special case a subroutine
with no POINTERs.
Dick Hendrickson
|