From: Volker Barthelmann <volker@vb.franken.de>
Subject: Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
Date: 1997/09/23 [thread overview]
Message-ID: <6085fm$3ea@vb.franken.de> (raw)
In-Reply-To: 6078ji$5j0@news2.zippo.com
Greg Lindahl <lindahl@pbm.com> wrote:
: jwest@jwest.ecen.okstate.edu (Jim West) writes:
: > I'm wondering if an optimizing compiler sould pick this up even without the
: > explicit definition of nx_r. Can anyone explain why it wouldn't?
: aliasing?
: -- g
: (no, I didn't look closely, but such a small kernel routine
: in C is always at risk for aliasing problems...)
Yes, a C compiler may not cache the values, because in
for (i=1;i<*nx-1;i++) {
indx = i+indj;
psi_new[indx] = (*a1)*psi[indx+1]+(*a2)*psi[indx-1]+
(*a3)*psi[i+indjp1]+(*a4)*psi[i+indjm1]-
(*a5)*f[indx];
}
the write to psi_new[indx] could modify all the other values.
When the restrict keyword will be supported in a future C standard
this could be avoided.
Volker
next prev parent reply other threads:[~1997-09-23 4:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5vqs28$3el@news-rocq.inria.fr>
1997-09-22 4:00 ` MFlops Comparison using g77 (bad news) - bench.tgz (0/1) Luke Lonergan
1997-09-22 4:00 ` Greg Lindahl
1997-09-22 4:00 ` Greg Lindahl
1997-09-22 4:00 ` Jim West
1997-09-23 4:00 ` Greg Lindahl
1997-09-23 4:00 ` Volker Barthelmann [this message]
1997-09-26 4:00 ` H.W. Stockman
1997-09-26 4:00 ` Greg Lindahl
1997-09-28 4:00 ` H.W. Stockman
1997-09-28 4:00 ` Greg Lindahl
1997-09-27 4:00 ` Toon Moene
1997-09-23 4:00 ` Luke Lonergan
1997-09-16 4:00 MFlops Comparison using g77 (bad news) Luke Lonergan
1997-09-16 4:00 ` Toon Moene
1997-09-16 4:00 ` MFlops Comparison using g77 (bad news) - bench.tgz (0/1) Luke Lonergan
1997-09-18 4:00 ` Thomas Leitner
1997-09-18 4:00 ` Andrew G. Morgan
1997-09-18 4:00 ` H.W. Stockman
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox