djulien 0 Posted August 31, 2012 Report Share Posted August 31, 2012 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 Quote Link to post Share on other sites
Recommended Posts
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.