Jump to content
djulien

Boostc Extra Instructions After Optimization

Recommended Posts

Bug description:

Optimization is leaving extra instructions in the example cases below.

 

Steps to reproduce:

Example 1:

unsigned char var1, var2;
var1 = var2 = 0;

 

code generated:

clrf var1
movlw 0	;this instr is not needed
clrf var2

 

Example 2:

unsigned char var3, var4, var5;
var3 = 3;
var4 = var3;

var5 = var3 + var4;

 

code generated:

movlw 3
movwf var3
movf var3, w   ;this instr is not needed
movwf var4
movf var4, w   ;this instr is not needed
addwf var3, w
movwf var5

 

Expected behaviour:

Example 1:

clrf var1
clrf var2

 

Example 2:

movlw 3
movwf var3
movwf var4
addwf var3, w
movwf var5

 

 

Is the problem 100% reproduceable:

yes

 

Compiler:

BoostC

 

Compiler version:

7.10, 7.051 and 7.04 also (I didn't test prior to that)

 

Target device:

PIC16F1827, '1823, '688, etc.

 

OS:

Windows XP

 

 

don

Edited by djulien

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 emoticons maximum 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...

×