internal compiler error: in reload_cse_simplify_operands, at postreload.c

Asked by Mark Müller

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_cse_simplify_operands, at postreload.c:411".

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_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/lto-wrapper
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-9-build/src/gcc/configure --target=arm-none-eabi --prefix=/home/build/work/GCC-4-9-build/install-native --libexecdir=/home/build/work/GCC-4-9-build/install-native/lib --infodir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-9-build/install-native/arm-none-eabi --build=i686-linux-gnu --host=i686-linux-gnu --with-gmp=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-mpfr=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-mpc=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-isl=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-cloog=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-libelf=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,cortex-m7,armv7-r
Thread model: single
gcc version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977] (GNU Tools for ARM Embedded Processors)

--------------------------------------------------------------
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_LEVEL=10 -O2 -g3 -Wall -Wextra -fmessage-length=0 -ffunction-sections -c -fno-exceptions -mslow-flash-data -fno-rtti -save-temps f.cpp

--------------------------------------------------------------
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(MatrixLayout layout, int lda) :
  _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(k,i)]*L[indL(j,i)];
   }
   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::SUCCESS;
 }
 else {
  return MathErrors::ARGUMENT_ERROR;
 }
}

--------------------------------------------------------------
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])
        (const_double:SF 0.0 [0x0.0p+0])) f.cpp:81 609 {*thumb2_movsf_vfp}
     (nil))
f.cpp:91:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:411
Please submit a full bug report,

Question information

Language:
English Edit question
Status:
Expired
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.