-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to find a register to spill in class 'POINTER_REGS' #158
Comments
Please put your code into "```" brackets so it can be read better. |
I'm compiling for Mega2560 but get same error if compile for UNO as well. To me it's a compiler optimization error with pointers. |
Yep, it's a gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60040). |
I just tried 5.1, still broken. I've reduced this testcase to work outside of Arduino and added it to the gcc bug report. @danlu01, it seems that enabling O2 (more optimizations) prevents this issue from occurring with your code. As a workaround, you could add this near the top of your sketch, to compile just that one function with O2 optimizations:
(just tried, works for me) |
Thanks for the workaround.. run into another compiler bug. I'll create another ticket. |
All; I have the same problem and it doesn't involve floats (though I use floats elsewhere). As I uncomment more of my class, the constructor, AD_Synth::AD_Synth(ThreeWire& com_port), I get the "register to spill" message. I tried the attribute workaround with no success. BTW: When I wrote it all as C-based (not a class) code, the large struct worked just peachy, with essentially the same function as the method. Sorry about the length of the code and especially the attributes -- but the ADF4351 synthesizer is a complicated device. Regards, |
I was having the same issue and I simply resolved it. All what I did is downloading the LAST UPDATE (4 October 2016 14:52:59 GMT) for Arduino software in the software download page (Arduino software hourly builds) at the bottom left of the page. The sketch was successfully compiled. |
I just tried an hourly build "21 October 2016 16:13:52 GMT" - which came with 'avr-gcc (GCC) 4.9.2' but it didn't solve the problem for me.
|
Looks like I just got the same problem with Arduino 1.6.11 but in one place of the sketch this line:
With just one parameter a compilation is Ok: |
According to the GCC bug, this will be fixed in GCC 7.0. They might backport the fix to earlier versions, if so I think it should be mentioned in the bug report as well. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60040 |
For some reason this is a work-around for gcc bug: arduino/Arduino#3972
Hello All, |
So am I. Used to work, I don't remember what was the IDE version (had to reinstall everything after hdd crash) |
Looks like it's fixed by avr core version 1.8.1 (using toolchain 7.4.0) |
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:
The text was updated successfully, but these errors were encountered: