internal compiler error: in reload_cse_simplify_operands, at postreload.c
I have a CPP file which fails to compile with any optimization other than -O0. The output is
" error: insn does not satisfy its constraints:"
and
"internal compiler error: in reload_
Setting to -O3 causes the error. Should I file this as a bug?
-------
The output of `arm-none-eabi-g++ -v` is :
Using built-in specs.
COLLECT_
COLLECT_
Target: arm-none-eabi
Configured with: /home/build/
Thread model: single
gcc version 4.9.3 20150529 (release) [ARM/embedded-
-------
The command I'm using to compile is:
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c++0x -DSTM32F405RGTx -DSTM32F4 -DSTM32 -DDEBUG -Dnullptr=0U -DVS_LOGGING_
-------
The code is below:
#include <cmath>
#include <limits>
#include <algorithm>
enum MatrixLayout {
ROW_MAJOR,
COLUMN_MAJOR
};
namespace MathErrors {
enum Error {
SUCCESS = 0,
ARGUMENT_ERROR,
};
}
struct rectangular_tag {};
struct squared_tag : public rectangular_tag {};
template<int NROWS, int NCOLS>
struct MatrixTrait {
typedef rectangular_tag shape_category;
};
template<int N>
struct MatrixTrait<N, N> {
typedef squared_tag shape_category;
};
class Indexing {
public:
Indexing(
_rowFactor(layout == ROW_MAJOR ? lda : 1),
_colFactor(layout == ROW_MAJOR ? 1 : lda)
{}
inline int operator()(int i, int j) {
return i * _rowFactor + j * _colFactor;
}
private:
int _rowFactor;
int _colFactor;
};
MathErrors::Error Potrf (MatrixLayout matrix_layout, int n,
const float * __restrict__ A, squared_tag, int lda,
float * __restrict__ L, squared_tag, int ldl) {
Indexing indA(matrix_layout, lda);
Indexing indL(matrix_layout, ldl);
bool isspd = true;
// Main loop.
for (int j = 0; j < n; j++)
{
float d(0.0);
for (int k = 0; k < j; k++)
{
float s(0.0);
for (int i = 0; i < k; i++)
{
s += L[indL(
}
L[indL(j,k)] = s = (A[indA(j,k)] - s)/L[indL(k,k)];
d = d + s*s;
isspd = isspd && (A[indA(k,j)] == A[indA(j,k)]);
}
d = A[indA(j,j)] - d;
isspd = isspd && (d > 0.);
L[indL(j,j)] = std::sqrt(d > 0. ? d : 0.);
for (int k = j+1; k < n; k++)
{
L[indL(j,k)] = 0.;
}
}
if(isspd) {
return MathErrors:
}
else {
return MathErrors:
}
}
-------
The complete error is:
f.cpp: In function 'MathErrors::Error Potrf(MatrixLayout, int, const float*, squared_tag, int, float*, squared_tag, int)':
f.cpp:91:1: error: insn does not satisfy its constraints:
}
^
(insn 255 258 502 27 (set (reg:SF 31 s15 [326])
(nil))
f.cpp:91:1: internal compiler error: in reload_
Please submit a full bug report,
Question information
- Language:
- English Edit question
- Status:
- Expired
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: