Jump to content
Sign in to follow this  
SnakeByte

Boostc 1.6 Alpha Bug

Recommended Posts

Here's the example code. Note that the array isn't actually even used in any code:

 

#include <system.h>

 

char list[500] = { 36, 11, 25, 27, 18, 47, 49, 14, 37, 19, 12, 23, 24, 9, 3, 9, 46, 8, 4, 35, 5, 2, 44, 20, 44,

11, 17, 17, 38, 9, 28, 1, 34, 30, 47, 5, 28, 1, 32, 0, 45, 45, 1, 28, 18, 50, 45, 16, 25, 26,

22, 25, 39, 29, 11, 32, 35, 34, 47, 49, 21, 23, 45, 22, 45, 42, 24, 47, 25, 2, 12, 33, 0, 25, 42,

15, 16, 11, 32, 25, 3, 12, 6, 4, 40, 10, 28, 4, 3, 27, 3, 28, 6, 0, 16, 41, 36, 49, 8, 20,

18, 7, 11, 38, 17, 16, 23, 45, 12, 41, 8, 44, 30, 28, 6, 5, 23, 4, 40, 40, 37, 28, 7, 3, 23,

2, 21, 38, 5, 3, 15, 39, 36, 46, 38, 26, 38, 10, 28, 23, 27, 21, 29, 24, 32, 27, 34, 2, 11, 2,

25, 46, 23, 34, 1, 4, 17, 19, 17, 30, 24, 15, 12, 7, 38, 30, 18, 37, 13, 49, 0, 32, 46, 9, 29,

35, 40, 34, 45, 34, 2, 46, 20, 37, 44, 14, 42, 47, 48, 42, 39, 13, 23, 2, 34, 47, 20, 21, 2, 17,

44, 29, 28, 27, 46, 40, 17, 28, 17, 24, 26, 14, 1, 42, 40, 3, 50, 29, 9, 27, 18, 43, 5, 22, 43,

11, 16, 38, 3, 16, 27, 20, 24, 43, 23, 26, 25, 45, 38, 38, 9, 40, 10, 44, 47, 22, 14, 46, 49, 30,

44, 22, 43, 1, 35, 14, 17, 31, 20, 47, 30, 27, 10, 45, 50, 9, 32, 30, 29, 38, 12, 21, 49, 10, 40,

36, 1, 8, 22, 28, 19, 41, 50, 23, 2, 46, 29, 22, 28, 29, 21, 29, 32, 37, 1, 47, 20, 38, 30, 25,

22, 22, 5, 24, 30, 5, 10, 14, 38, 12, 40, 47, 38, 5, 20, 26, 30, 32, 10, 47, 39, 23, 39, 7, 9,

1, 11, 38, 19, 37, 44, 14, 12, 49, 11, 48, 48, 41, 17, 19, 34, 43, 30, 18, 30, 12, 37, 6, 37, 43,

32, 50, 2, 34, 32, 25, 32, 24, 47, 3, 29, 49, 19, 48, 19, 4, 18, 37, 43, 18, 31, 23, 20, 1, 10,

38, 38, 4, 35, 0, 17, 24, 39, 43, 0, 18, 28, 27, 4, 23, 30, 14, 20, 39, 9, 9, 37, 10, 46, 18,

18, 26, 19, 27, 33, 40, 0, 46, 15, 45, 1, 23, 0, 40, 0, 31, 46, 34, 29, 24, 48, 26, 19, 1, 36,

8, 10, 15, 9, 37, 8, 9, 15, 12, 4, 2, 17, 39, 45, 20, 28, 28, 23, 37, 20, 14, 46, 49, 26, 40,

47, 21, 46, 12, 14, 32, 45, 48, 19, 22, 31, 32, 49, 31, 3, 23, 18, 10, 41, 15, 33, 34, 42, 3, 33,

11, 38, 46, 20, 47, 12, 15, 5, 35, 17, 22, 10, 38, 38, 34, 32, 34, 19, 22, 2, 37, 36, 14, 34, 26 };

 

void main()

{

 

}

 

Compiler errors out with:

Memory allocation failed!

Share this post


Link to post
Share on other sites

This is not an error. It is stated in BoostC help that an array must fit in register bank.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
This is not an error. It is stated in BoostC help that an array must fit in register bank.

 

Regards,

Pavel

 

 

Ah, yes it does:

"Arrays can have any number of dimensions. An array must fit into [a] register bank. "

 

but the help also mentions:

"Eliminates unreachable (or dead) code - reduces code memory usage."

 

Since the example code never actually uses the array, I thought that the optimizer would have ignored it.

 

Basically, I'd like to be able to compile the code on linux or windows, debug what I can there first, and then just #ifdef out the stuff that wouldn't be required for the chip.

 

It looks like the compiler works fine if I #ifdef the array itself out too (instead of #ifdefing stuff out of main or any functions), so I'll just do that instead.

 

Thanks Pavel.

Share this post


Link to post
Share on other sites

This array is from global scope and optimizing out variables from there is a bit trickier than from functions. This work is in our todo list.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...