aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@1c20744c-e24a-42ec-9533-f5004cb800e5>2001-02-15 20:34:02 +0000
committertradke <tradke@1c20744c-e24a-42ec-9533-f5004cb800e5>2001-02-15 20:34:02 +0000
commit04d3cfc1b7d2e7cf6c8107cc8d79003e32ed1eaa (patch)
treee2eeb7103b0b86f4695cd9438d52042096f18669
parent50a96689532502e6f9520dc25ff4d280cb186c10 (diff)
The buggy Hitachi compiler still wants a 'volatile' qualifier for some
variables otherwise optimized code will crash. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHInterp/trunk@7 1c20744c-e24a-42ec-9533-f5004cb800e5
-rw-r--r--src/Operator.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Operator.c b/src/Operator.c
index 76a71f5..5c64810 100644
--- a/src/Operator.c
+++ b/src/Operator.c
@@ -460,7 +460,7 @@ int PUGHInterp_InterpGV (cGH *GH,
else
{
/* dereferencing such an address should code crash on most systems */
- type_desc[type].send_buffer = (void *) 1;
+ type_desc[type].send_buffer = (void *) type_desc[type].vtypesize
}
}
@@ -555,7 +555,7 @@ int PUGHInterp_InterpGV (cGH *GH,
else
{
/* access to such a fake address should crash the code on most systems */
- type_desc[type].recv_buffer = (void *) 1;
+ type_desc[type].recv_buffer = (void *) type_desc[type].vtypesize;
}
/* now exchange the data for this CCTK data type */
@@ -803,7 +803,10 @@ int PUGHInterp_InterpLocal (cGH *GH,
int out_array_types[])
{
int dim, point, retval;
- CCTK_REAL *coords, *origin, *delta, **data;
+ CCTK_REAL *coords, *origin, *delta;
+/* FIXME: the volatile qualifier is just a workaround for compiler bug
+ on the Hitachi SR8000 machine, without it optimized code will crash */
+ volatile CCTK_REAL **data;
/* check arguments */
@@ -831,7 +834,7 @@ int PUGHInterp_InterpLocal (cGH *GH,
/* get the grid spacings - this assumes a cartesian grid */
origin = (CCTK_REAL *) malloc (2 * num_dims * sizeof (CCTK_REAL));
delta = origin + num_dims;
- data = (CCTK_REAL **) coord_arrays;
+ data = (volatile CCTK_REAL **) coord_arrays;
for (dim = 0; dim < num_dims; dim++)
{
origin[dim] = data[dim][0];
@@ -840,7 +843,7 @@ int PUGHInterp_InterpLocal (cGH *GH,
/* sort the individual interpolation coordinate arrays into a single one */
coords = (CCTK_REAL *) malloc (num_dims * num_points * sizeof (CCTK_REAL));
- data = (CCTK_REAL **) interp_coord_arrays;
+ data = (volatile CCTK_REAL **) interp_coord_arrays;
for (point = 0; point < num_points; point++)
{
for (dim = 0; dim < num_dims; dim++)