Browse Source

Math: work around GCC 4.9 crash in Android NDK.

Seems to be only in case of this particular function in the test and
nowehere else. Won't bother investigating further.
pull/157/head
Vladimír Vondruš 10 years ago
parent
commit
1411e2e85b
  1. 9
      src/Magnum/Math/Test/QuaternionTest.cpp

9
src/Magnum/Math/Test/QuaternionTest.cpp

@ -399,6 +399,13 @@ void QuaternionTest::matrix() {
CORRADE_COMPARE(Quaternion::fromMatrix(m4), q4);
}
/* The crappy 4.9 20140827 (prerelease) in Android NDK segfaults when
optimizing the following function. Dialing down the optimization helps. No
problem when calling Math::lerp() anywhere else, so I won't dig further.
Fuck this. */
#if defined(CORRADE_TARGET_ANDROID) && __GNUC__*100 + __GNUC_MINOR__*10 + __GNUC_PATCHLEVEL__ == 490
#pragma GCC push_options
#pragma GCC optimize("O0")
void QuaternionTest::lerp() {
Quaternion a = Quaternion::rotation(Deg(15.0f), Vector3(1.0f/Constants<Float>::sqrt3()));
Quaternion b = Quaternion::rotation(Deg(23.0f), Vector3::xAxis());
@ -416,6 +423,8 @@ void QuaternionTest::lerp() {
Quaternion lerp = Math::lerp(a, b, 0.35f);
CORRADE_COMPARE(lerp, Quaternion({0.119127f, 0.049134f, 0.049134f}, 0.990445f));
}
#pragma GCC pop_options
#endif
void QuaternionTest::slerp() {
Quaternion a = Quaternion::rotation(Deg(15.0f), Vector3(1.0f/Constants<Float>::sqrt3()));

Loading…
Cancel
Save