Fatal compiler internal error

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
perjar
Posts: 29
Joined: 08 Apr 2018 18:02

Fatal compiler internal error

Post by perjar » 27 Sep 2018 23:05

Hi,

I am getting a compiler error all of a sudden. Appeared between two compiles without any change of the sourcecode in between.
First did a "verify" in the IDE and it worked fine. No compile or build errors.
Then clicked on "upload" to send it over to the board. Then suddenly I am getting this:

z-meter_ucxx.c:1178: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/mcs51/gen.c' line number '472' : getFreePtr should never reach here

"z-meter" is the name of my sketch.

I have uninstalled and installed the IDE but that does not change anything.

Does anyone know what the error migth mean? "internal" sounds like it has nothing to do with my sketch, but that is probably just wishful thinking. Especially since other sketches work just fine.

User avatar
PoltoS
Posts: 4262
Joined: 26 Jan 2011 19:36

Re: Fatal compiler internal error

Post by PoltoS » 29 Sep 2018 08:40

Can you send us the Sketch?

perjar
Posts: 29
Joined: 08 Apr 2018 18:02

Re: Fatal compiler internal error

Post by perjar » 29 Sep 2018 18:52

Hi,


Unfortunately, I have made some changes to the code so I am not getting the same error anymore. Now it is a javanullpointerexception instead.

Sending two versions of the code with the respective compiler output:

z-meter_a: No nullpointexception in this one, but I could not get around the compilation error so when I got this error output I continued with z-meter_b.

z-meter_b: The only difference from z-meter_a is that some z-uno macros are now commented away. This is where the nullpointerexcpetion happens.

I appreciate the help!
Best regards
Per
Attachments
z-meter.zip
source code and compiler output
(8.66 KiB) Downloaded 9 times

User avatar
PoltoS
Posts: 4262
Joined: 26 Jan 2011 19:36

Re: Fatal compiler internal error

Post by PoltoS » 30 Sep 2018 01:01

z-meter_a: You had DEBUGLN((getter_power); - two ( opened and one closed ). This lead to undefined function and missing getters/resetters in channels.

But once you fix this small typo, there would be another problem that we are unable to fix currently: compiler compains on something strange. We are checking this.

Please also note that extensive usage of float is very bad on 8-bits MCU.

Also using of system functions (in your case millis) in interrupts is a very bad idea. Better to save the value of milis in the loop and save it to a variable that will be used in the ISR.

User avatar
PoltoS
Posts: 4262
Joined: 26 Jan 2011 19:36

Re: Fatal compiler internal error

Post by PoltoS » 02 Oct 2018 12:52

PoltoS wrote:
30 Sep 2018 01:01
But once you fix this small typo, there would be another problem that we are unable to fix currently: compiler compains on something strange. We are checking this.
Interresting! This error occurs when no free registers are available during compilation. This means that your code was too heavy for this 8-bit CPU. Please minimize the usage of float and long to the minimum. In most cases you never need other than int.

perjar
Posts: 29
Joined: 08 Apr 2018 18:02

Re: Fatal compiler internal error

Post by perjar » 02 Oct 2018 14:14

Thank you very much for the analysis and the advise!

You are perfectly right of course, I am over-using float, and it's pure laziness on my part. I will revise the code as advised.

Thanks a bunch!

Post Reply