From fc860140f123b9a6f0a868f91ac5793c50f43172 Mon Sep 17 00:00:00 2001 From: Julien Lecoeur Date: Thu, 1 Jun 2017 10:59:33 +0200 Subject: [PATCH] Fix internal compiler error with GCC 7 Here is the error message: PX4/Firmware/src/systemcmds/tests/test_matrix.cpp:641:1: internal compiler error: in trunc_int_for_mode, at explow.c:55 } ^ Please submit a full bug report, with preprocessed source if appropriate. --- src/systemcmds/tests/test_matrix.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/systemcmds/tests/test_matrix.cpp b/src/systemcmds/tests/test_matrix.cpp index eef8451cd3..5285591f04 100644 --- a/src/systemcmds/tests/test_matrix.cpp +++ b/src/systemcmds/tests/test_matrix.cpp @@ -624,7 +624,9 @@ bool MatrixTest::vector2Tests() ut_test(fabs(c(0) - 0) < 1e-5); ut_test(fabs(c(1) - 0) < 1e-5); - Matrix d(a); + static Matrix d(a); + // the static keywork is a workaround for an internal bug of GCC + // "internal compiler error: in trunc_int_for_mode, at explow.c:55" ut_test(fabs(d(0, 0) - 1) < 1e-5); ut_test(fabs(d(1, 0) - 0) < 1e-5);