Skip to content

unable to find a register to spill in class 'POINTER_REGS' #158

@danlu01

Description

@danlu01

I upgraded from Arduino IDE 1.0.6 to 1.6.5 and now my sketch have compile error:

unable to find a register to spill in class 'POINTER_REGS'

I've narrow it down to a function (I've modified it to try to understand the compile error). Odd thing is if I remove any of the 4 line of code in the for loop, then it compiles ok. Here's the test sketch with this issue:

float dhistory[10];
float test;

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

  test = getSlope(dhistory);
}

float getSlope(float history[]) {
  float sumx = 0;
  float sumy = 0;
  float sumxy = 0;
  float sumxsq = 0;
  float rate = 0;
  int n = 10;

  for (int i=1; i< 11; i++) {
    sumx = sumx + i;
    sumy = sumy + history[i-1];
    sumy = sumy + history[i-1];
    sumxsq = sumxsq + (i*i);
  } 

  rate = sumy+sumx+sumxsq;
  return rate;
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions