Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic error: unable to find a register to spill in class 'POINTER_REGS (Read 6155 times)
Scott Wilson
Newbies
*
Offline


Posts: 4
Joined: Oct 21st, 2016
error: unable to find a register to spill in class 'POINTER_REGS
Dec 14th, 2016 at 1:12am
Print Post  
Hi, I'm getting a very strange compiler when I include the attached file. This file is a variant of a file that I have used many times. As far as I can tell, the issue is the number of elements in input_hidden1_weights or one of the other arrays. That is, I don't see this problem when InputCount is smaller, etc. I'm using VS2015 and have the latest uMicro add in. Thanks, Scott


namespace HoverTable2
{
#include "Test 20161212UpTo HoverTable2_180.h"
}

***** 

PumpControl_Dancing002.ino:879: In file included from
 
Test 20161212UpTo HoverTable2_180.h: In function void HoverTable2::ScaleInputs(double*, double, double, int)
 
Test 20161212UpTo HoverTable2_180.h: 91:1: error: unable to find a register to spill in class 'POINTER_REGS
 
Test 20161212UpTo HoverTable2_180.h: 91:1: error: this is the insn
(insn 96 95 98 3 (set (reg*: SF 124 [ D.6608 ])
        (mem*: SF (post_inc:HI (reg:HI 2 r2 [orig:133 ivtmp.447 ] [133])) [5 MEM[base: _33, offset: 0B]+0 S4 A8])) C:\Users\scottw\AppData\Local\Temp\VMBuilds\PumpControl_Dancing002\uno\Test 20161212UpTo HoverTable2_180.h:88 99 {*movsf}
     (expr_list*: REG_INC (reg:HI 2 r2 [orig:133 ivtmp.447 ] [133])
   (nil)))
Test 20161212UpTo HoverTable2_180.h:91: confused by earlier errors, bailing out
Error compiling project sources
Build failed for project 'PumpControl_Dancing002'
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Scott Wilson
Newbies
*
Offline


Posts: 4
Joined: Oct 21st, 2016
Re: error: unable to find a register to spill in class 'POINTER_REGS
Reply #1 - Dec 14th, 2016 at 6:02pm
Print Post  
It appears this is a gcc bug, fixed in v7. I'm not sure how to get this fix into my vMicro environment....

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60040
« Last Edit: Dec 14th, 2016 at 6:02pm by Scott Wilson »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: unable to find a register to spill in class 'POINTER_REGS
Reply #2 - Dec 14th, 2016 at 6:09pm
Print Post  
Hi,

Visual micro doesn't have any of these sources in it. Instead it uses the sources provided by your config. This means the arduino ide installation and/or the hardware you have installed.

It's not possibe to see what version of arduino or what hardware you are using from your post.

Please switch on vmicro>compiler>verbose and also the "show build properties" switch. Then build and either post or email the build out as a .txt file.

Email info[at]visualmicro.com
  
Back to top
IP Logged
 
Scott Wilson
Newbies
*
Offline


Posts: 4
Joined: Oct 21st, 2016
Re: error: unable to find a register to spill in class 'POINTER_REGS
Reply #3 - Dec 14th, 2016 at 6:34pm
Print Post  
Thanks, attached is the output.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: unable to find a register to spill in class 'POINTER_REGS
Reply #4 - Dec 14th, 2016 at 6:58pm
Print Post  
Hi,

You are using arduino 1.6.8 which contains gcc 4.8.1

The link you posted shows this is resolved in gcc 4.8.3 but failed again in 4.9.0

If you update to arduino 1.6.13 and then look at the the "built_in_tools_version.txt" in folder "[ArduinoIDE_Folder\hardware\tools\avr" you will see it contains gcc 4.9.2

Hope that then works as hoped.

  
Back to top
IP Logged
 
Scott Wilson
Newbies
*
Offline


Posts: 4
Joined: Oct 21st, 2016
Re: error: unable to find a register to spill in class 'POINTER_REGS
Reply #5 - Dec 14th, 2016 at 7:30pm
Print Post  
Thanks so much for your help with this!

My reading of the bug history is different than yours, it appears the patch wasn't committed and still appears in 5.3.

Through some trial and error, I was able to work around the bug by making two of the arrays function local:

void ScaleInputs(double* input, double minimum, double maximum, int size)
{
     // SBW 2016.12.14 Fix for gcc error: : unable to find a register to spill in class 'POINTER_REGS
     // Make these arrays function local. Made const for good measure.
     const double max_input[InputCount] = { 1.20000000000000e+004, 3.21500000000000e+004, 3.24080000000000e+004, 1.89000000000000e+000, 2.01000000000000e+000, 1.20000000000000e-001, 1.00000000000000e+000, 1.19000000000000e+000, 2.26000000000000e+000, 5.15000000000000e+000 };
     const double min_input[InputCount] = { 2.00000000000000e+003, 3.18210000000000e+004, 3.16850000000000e+004, 1.14000000000000e+000, 0.00000000000000e+000, -1.85000000000000e+000, -9.60000000000000e-001, -1.60000000000000e-001, 5.20000000000000e-001, -1.39000000000000e+000 };
     for (long i=0; i<size; i++)
     {
           double delta = (maximum-minimum)/(max_input[i]-min_input[i]);
           input[i] = minimum - delta*min_input[i]+ delta*input[i];
     }
}
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: unable to find a register to spill in class 'POINTER_REGS
Reply #6 - Dec 14th, 2016 at 8:38pm
Print Post  
Yes I think you read better than me Smiley

Thanks for the update and hopefully arduino will update soon (although they only just updated to 4.9.2 and that took a very long time)


  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint