Unverified Commit eff1f26e authored by Peter Eastman's avatar Peter Eastman Committed by GitHub
Browse files

Workaround for bug in GCC 9 on PPC (#2998)

parent ffcabcf6
...@@ -62,8 +62,12 @@ public: ...@@ -62,8 +62,12 @@ public:
Voxels(int blockSize, float vsy, float vsz, float miny, float maxy, float minz, float maxz, const Vec3* boxVectors, bool usePeriodic) : Voxels(int blockSize, float vsy, float vsz, float miny, float maxy, float minz, float maxz, const Vec3* boxVectors, bool usePeriodic) :
blockSize(blockSize), voxelSizeY(vsy), voxelSizeZ(vsz), miny(miny), maxy(maxy), minz(minz), maxz(maxz), usePeriodic(usePeriodic) { blockSize(blockSize), voxelSizeY(vsy), voxelSizeZ(vsz), miny(miny), maxy(maxy), minz(minz), maxz(maxz), usePeriodic(usePeriodic) {
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++) for (int j = 0; j < 3; j++) {
periodicBoxVectors[i][j] = (float) boxVectors[i][j]; // Copying to a volatile temporary variable is a workaround for
// a bug in GCC9 on PPC.
volatile float temp = (float) boxVectors[i][j];
periodicBoxVectors[i][j] = temp;
}
periodicBoxSize[0] = (float) boxVectors[0][0]; periodicBoxSize[0] = (float) boxVectors[0][0];
periodicBoxSize[1] = (float) boxVectors[1][1]; periodicBoxSize[1] = (float) boxVectors[1][1];
periodicBoxSize[2] = (float) boxVectors[2][2]; periodicBoxSize[2] = (float) boxVectors[2][2];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment