Jump to content
Sign in to follow this  
djulien

Boostc_Pic16.exe Infinite Loop

Recommended Posts

Bug description:

The compiler goes into an infinite loop.

 

Example code:

#include <system.h>

typedef unsigned char uint8;

#define asmref(thing)  _##thing
#define PORTOF(thing)  ((thing)>>4)
#define PINOF(thing)  ((thing)&0xF)
#define LED1_PIN  0xA0

inline void bug(uint8& values)
{
 asm //use asm block to prevent dead code removal
 {
     goto return2caller;
	 nop;
;//  setbit_asm(asmref(values), LED1_PIN, FALSE); //turn bit off
	 bcf asmref(values)+PORTOF(LED1_PIN), PINOF(LED1_PIN);
	 goto return2caller;
return2caller:
 }
}

uint8 var1[10];

void main(void)
{
bug(var1[0]);
}

 

The example above is a simple function, but the problem is occurring in a much larger program that I have.

I assume that macros are allowed within asm blocks, since it is still the preprocessor at that point. I didn't see anything in the documentation that it was not allowed.

 

Expected behavior:

Preprocessor should expand the macros and then the compiler should generate the appropriate instructions for the example code.

 

Is the problem 100% reproduceable:

yes

 

Compiler:

BoostC

 

Compiler version:

7.10

 

Target device:

PIC16F1827, etc.

 

OS:

Windows XP

 

 

don

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  

×