Some lines of code not assembling in release mode.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Some lines of code not assembling in release mode.

1,377件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by AndreiS on Thu Mar 05 12:48:13 MST 2015
Hello,
   I am using the free edition (v7.5.0 build254) and my baby steps at learning this stuff is working well when I do a debug build.  However, when I change to release mode the behavior of my code change (verified with scope) and in the disassembler I can see lines of code missing (see attached).  For example the following two lines of code are only compiled once, but used several times:

i = 2500;
while(i) i--;

For example, in the attached screenshot lines 86, 92, and 99 (my "delays") are not in the disassembly.  They are present in a debug build.  Any help would be greatly appreciated.

Thanks,
0 件の賞賛
返信
2 返答(返信)

1,361件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by AndreiS on Thu Mar 05 14:39:10 MST 2015
Thank you very much.  Off to do some studying as its apparent I didn't fully understand how to use volatile.
0 件の賞賛
返信

1,361件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Mar 05 13:12:51 MST 2015
Missing 'volatile' keyword probably...

http://www.lpcware.com/content/faq/lpcxpresso/compiler-optimization

[ Release build typically compiles with -Os]

Regards,
LPCXpresso Support
0 件の賞賛
返信