|
Page 1 of 1
|
[ 12 posts ] |
|
RobotC FATAL error: Compiler error allocating new temporary
| Author |
Message |
|
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1023
|
 RobotC FATAL error: Compiler error allocating new temporary
Does anybody know what this error means for the following code? This code is part of a library. It compiles perfectly fine in other more complex programs but gives me the error below in a test program. **FATAL**:Compiler error allocating new temporary (HWM mismatch 12 (temp) vs 8 (pass 1 max)). Pass/Seq: 'Emit Code:112
|
| Fri Dec 03, 2010 3:57 pm |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2865 Location: Rotterdam, The Netherlands
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
It's probably be a bug in the compiler. Send the smallest test program you can make that reproduces the bug with the above code to support@robotc.net. - Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Fri Dec 03, 2010 5:42 pm |
|
 |
|
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1023
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
Striping down the program to the simplest and yet reproducing the bug is the time consuming part Our FTC regional is this weekend, so I probably won't have time until afterwards.
|
| Fri Dec 03, 2010 5:44 pm |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2865 Location: Rotterdam, The Netherlands
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
MHTS,
Do you have a work-around for now? Mail the program + library to me (mightor_a@t_gmail_.dot._com). I'll strip it down and mail the devs.
- Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Fri Dec 03, 2010 5:58 pm |
|
 |
|
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1023
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
Thanks Xander! I don't have a workaround. Like I said, this compiles fine for the competition program. It is only a problem with a test program. So I am not blocked by it. I just checked in the code to our source control server. You can access it on: http://proj.titanrobotics.net/hg/Ftc/20 ... b2179bd075The test program that caused the error is in test\LnFollower.c. Good luck in stripping it down. 
|
| Fri Dec 03, 2010 6:11 pm |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2865 Location: Rotterdam, The Netherlands
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
I found out what the problem was. in sm.h , the SM struct is declared as follows: The offending piece of code tries this: An easy work-around and proper fix of your code is to resize smFlags: Now it compiles just fine. I guess size really does matter  - Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Fri Dec 03, 2010 6:59 pm |
|
 |
|
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1023
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
But why? As I understand it, int in RobotC is 16 bits and I am using only 16 bits and doing bit-wise operation on 16 bit. Why is it a problem? I think the real problem is not the size, the real problem is SMF_READY happens to be the sign bit of the 16-bit int. If I changed SMF_READY to be 0x0200 instead of 0x8000, it works too. But still, why is this a problem?
Interestingly, the same library module used in another program compiles fine.
BTW, why is RobotC not supporting unsigned for all basic types? This is not very intuitive at all. I would have declared it as "unsigned int smFlags" if RobotC supports it.
|
| Sat Dec 04, 2010 2:54 am |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2865 Location: Rotterdam, The Netherlands
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
The only signed/unsigned type ROBOTC knows is the byte. I still think this is a bug but you have a good work-around now that will tide you over until the compiler is fixed. The following code will produce a warning: *Warning*:ROBOTC only supports 'unsigned' qualifier on 'byte' / 'char' sized variables. Ignored for other type.- Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Sat Dec 04, 2010 3:11 am |
|
 |
|
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1023
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
Yes, I know RobotC supports unsigned only for byte type (I tried it long time ago). That's why I don't understand the reason it doesn't support unsigned for other types. In my honest opinion, it is not orthogonal. It could introduce subtle bugs for both user code and the compiler. The unsigned qualifier should be applicable to all basic types.
|
| Sat Dec 04, 2010 3:19 am |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2865 Location: Rotterdam, The Netherlands
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
You could write a request for change to support@robotc.net but I wouldn't hold out too much hope for it to be implemented. All environments have their limitations and this lack of unsigned ints and longs is just something you'll have to work with  I do think what you've seen is a bug or at least something that should be handled differently by the compiler. I will send the devs the code that causes this problem so they can take a look at it and perhaps fix it. - Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Sat Dec 04, 2010 3:40 am |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2865 Location: Rotterdam, The Netherlands
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
I've mailed the devs.
- Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Sat Dec 04, 2010 3:50 am |
|
 |
|
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1023
|
 Re: RobotC FATAL error: Compiler error allocating new temporary
Thanks Xander!
|
| Sat Dec 04, 2010 3:54 am |
|
|
|
Page 1 of 1
|
[ 12 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|