diff --git a/MicroBenchmarks/LCALS/SubsetCLambdaLoops/LambdaSubsetCbenchmarks.cxx b/MicroBenchmarks/LCALS/SubsetCLambdaLoops/LambdaSubsetCbenchmarks.cxx --- a/MicroBenchmarks/LCALS/SubsetCLambdaLoops/LambdaSubsetCbenchmarks.cxx +++ b/MicroBenchmarks/LCALS/SubsetCLambdaLoops/LambdaSubsetCbenchmarks.cxx @@ -379,16 +379,16 @@ forall(0, state.range(0), [&] (Index_type ip) { Index_type i1, j1, i2, j2; - i1 = (Index_type) p[ip][0]; - j1 = (Index_type) p[ip][1]; + i1 = (Index_type) (long long) p[ip][0]; + j1 = (Index_type) (long long) p[ip][1]; i1 &= 64-1; j1 &= 64-1; p[ip][2] += b[j1][i1]; p[ip][3] += c[j1][i1]; p[ip][0] += p[ip][2]; p[ip][1] += p[ip][3]; - i2 = (Index_type) p[ip][0]; - j2 = (Index_type) p[ip][1]; + i2 = (Index_type) (long long) p[ip][0]; + j2 = (Index_type) (long long) p[ip][1]; i2 = ( i2 & 64-1 ) ; j2 = ( j2 & 64-1 ) ; p[ip][0] += y[i2+32]; @@ -435,8 +435,8 @@ xx[k] = 0.0; ix[k] = (Index_type) grd[k]; xi[k] = (Real_type) ix[k]; - ex1[k] = ex[ ix[k] - 1 ]; - dex1[k] = dex[ ix[k] - 1 ]; + ex1[k] = ix[k] ? ex[ ix[k] - 1 ] : 0; + dex1[k] = ix[k] ? dex[ ix[k] - 1 ] : 0; } ); forall(0, state.range(0), diff --git a/MicroBenchmarks/LCALS/SubsetCRawLoops/RawSubsetCbenchmarks.cxx b/MicroBenchmarks/LCALS/SubsetCRawLoops/RawSubsetCbenchmarks.cxx --- a/MicroBenchmarks/LCALS/SubsetCRawLoops/RawSubsetCbenchmarks.cxx +++ b/MicroBenchmarks/LCALS/SubsetCRawLoops/RawSubsetCbenchmarks.cxx @@ -549,16 +549,16 @@ for (Index_type ip=0 ; ip< state.range(0) ; ip++ ) { Index_type i1, j1, i2, j2; - i1 = (Index_type) p[ip][0]; - j1 = (Index_type) p[ip][1]; + i1 = (Index_type) (long long) p[ip][0]; + j1 = (Index_type) (long long) p[ip][1]; i1 &= 64-1; j1 &= 64-1; p[ip][2] += b[j1][i1]; p[ip][3] += c[j1][i1]; p[ip][0] += p[ip][2]; p[ip][1] += p[ip][3]; - i2 = (Index_type) p[ip][0]; - j2 = (Index_type) p[ip][1]; + i2 = (Index_type) (long long) p[ip][0]; + j2 = (Index_type) (long long) p[ip][1]; i2 = ( i2 & 64-1 ) ; j2 = ( j2 & 64-1 ) ; p[ip][0] += y[i2+32]; @@ -631,8 +631,8 @@ xx[k] = 0.0; ix[k] = (Index_type) grd[k]; xi[k] = (Real_type) ix[k]; - ex1[k] = ex[ ix[k] - 1 ]; - dex1[k] = dex[ ix[k] - 1 ]; + ex1[k] = ix[k] ? ex[ ix[k] - 1 ] : 0; + dex1[k] = ix[k] ? dex[ ix[k] - 1 ] : 0; } for (Index_type k=0 ; k< state.range(0) ; k++ ) {