Jump to content
Sign in to follow this  
steveT

"trying To Add Bank Switching" Error

Recommended Posts

I get the following linker error in very replicable situations.

Internal Error: Trying to add bank switching for var that has no memory allocated:'del' ('delay_ms_00000_arg_del',0xF0000010)

For example, the following program produces this error:

#define P16F877A
#include <system.h>
#pragma CLOCK_FREQ 19660800

void main()
{

while( 1 )
{
}

while( 1 )
{
	delay_s(1);
}

mainendloop: goto mainendloop;
}

 

It seems like the dead code (i.e. the delay_s function) gets removed, as does its parameter (delay_ms_00000_arg_del), but the parameter is still referenced somewhere internally.

Share this post


Link to post
Share on other sites

Steve,

It seems like the dead code (i.e. the delay_s function) gets removed, as does its parameter (delay_ms_00000_arg_del), but the parameter is still referenced somewhere internally.

Yes, this looks like a problems. I'm now investigating further.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Steve,

 

The problem was that when a function was called from an unreachable section (dead code) the function was not being correctly removed. When user functions call from such code they did not create an error, but the function code was left behind.

 

This problem has been fixed and will be in the next release or patch.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
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  

×