无法在类 'POINTER_REGS' 中找到溢出的寄存器(可能是编译器错误)
unable to find a register to spill in class 'POINTER_REGS' (maybe compiler bug)
问题是此代码不会使用avr-g++编译器进行编译。它在标题中产生了错误。当您注释掉第15行或第16行时,它将编译。如果从第15行和第16行的右侧删除"colorArray"或"lackArray",它将进行编译。如果将第15行和第16行的"greyDiff"分别替换为变量赋值的右侧。如果它不在for循环中,它确实会编译。这不是编译器的错误吗?
float colourArrayL[3] = {0, 0, 0};
float whiteArrayL[3] = {0, 0, 0};
float blackArrayL[3] = {0, 0, 0};
float colourArrayR[3] = {0, 0, 0};
float whiteArrayR[3] = {0, 0, 0};
float blackArrayR[3] = {0, 0, 0};
void setup()
{
for (byte i = 0; i < 3; i++)
{
float greyDiffL = whiteArrayL[i] - blackArrayL[i]; //the highest possible return minus the lowest returns the area for values in between
float greyDiffR = whiteArrayR[i] - blackArrayR[i];
colourArrayL[i] = (colourArrayL[i] - blackArrayL[i]) / greyDiffL;
colourArrayR[i] = (colourArrayR[i] - blackArrayR[i]) / greyDiffR;
}
}
void loop() {};
我一直在使用avr-g++(GCC)4.8.1,在为自定义类rgbscenario00编写复制构造函数时也有类似的经验。在复制构造函数内复制5个以上rgbled对象时显示错误。我通过添加2个私有方法(使用diver&conquest)解决了这个问题。因此,编译器似乎试图使用所有寄存器,当它们都被使用时,它会以错误停止。这是我的解决方案(只显示重要部分:)
void rgbscenario00::copyrgb123( const rgbscenario00& orig ) {
magenta = orig.magenta;
rood = orig.rood;
geel = orig.geel;
}
void rgbscenario00::copyrgb456( const rgbscenario00& orig ) {
groen = orig.groen;
blauw = orig.blauw;
oranje = orig.oranje;
// uncommenting this last oranje line resulted in
// "error: unable to find a register to spill
// in class 'POINTER_REGS' "
}
rgbscenario00::rgbscenario00(const rgbscenario00& orig) {
// I have to split up this copy constructor to avoid
// getting a very silly error on the lack of registers
copyrgb123( orig );
copyrgb456( orig );
//magenta = orig.magenta; rood = orig.rood; geel = orig.geel;
//groen = orig.groen; blauw = orig.blauw;
//oranje = orig.oranje;
// uncommenting this oranje line resulted in
// "error: unable to find a register to spill
// in class 'POINTER_REGS' "
inputString = orig.inputString;
stringComplete = orig.stringComplete;
iteller = orig.iteller;
huedeviation = orig.huedeviation;
lumdeviation = orig.lumdeviation;
uiteller = orig.uiteller;
ujchosen = orig.ujchosen;
usbspeed = orig.usbspeed;
currentmillis = orig.currentmillis;
prevmillis = orig.prevmillis;
millisperloop = orig.millisperloop;
millisperstep = orig.millisperstep;
tfuture = orig.tfuture;
tstep = orig.tstep;
copyboolarray(&(computed[0]),&(orig.computed[0]),maxuirgblednum );
copyboolarray(&(done[0]), &(orig.done[0]), maxuirgblednum );
copyuliarray( &(nexttime[0]),&(orig.nexttime[0]),maxuirgblednum );
copyuiarray(&(uilumvalues[0]),&(orig.uilumvalues[0]),
maxuilumvalues );
}
相关文章:
- 本质:使用__128寄存器
- 将寄存器设计成可由C和C++访问的外设的最佳实践
- 在模拟器中使用并集来模拟CPU寄存器有多合适
- 使用英特尔 PIN 修改寄存器
- 初始化迭代器错误 C++ 在 GCC 编译器中
- 链接器错误:未定义对"Reference_Genome::seq[abi:cxx11]"的引用
- C++ 运行时链接器错误 (liblog4cpp.so.5) Eclipse
- 模板重载会导致链接器错误/奇怪的行为
- 无法使函数公开。获取:"LNK2005"错误。如何调试链接器错误
- AVX 指令中寄存器和指针之间的客观差异
- Clang 8 带有静态 constexpr 和数组的链接器错误 - 错误是什么以及如何解决它?
- 未知的 GCC 链接器错误,但已成功构建
- 在静态库中使用输出迭代器时出现链接器错误
- 如何确定我的处理器有多少个 AVX 寄存器?
- 使用 glvertex4i 传递网格面索引时的顶点着色器错误
- 链接器错误:无法解析构造函数
- 无法在类 'POINTER_REGS' 中找到溢出的寄存器(可能是编译器错误)
- 寄存器c++14和gcc的编译错误
- 状态寄存器错误
- 嵌入式应用程序写寄存器时出现分段错误