Recently, I have seen a very strange behaviour on uvision4.
When I use a local double variable in my function, it compiles but I see NOP on disassamble window which corresponds to my variable.What is more, double operations which I implement in function has meaningless assemble code as well. However when I change my local variable to static double, it compiles and generates assemble code for my variable and also for my double operations as well.
So I thought that could be limitation for evaluation software, and compile the same code on a licensed computer. Guess what, It generates working code.Everything is OK. So I was wondering if this is a limitation for evaluation software which claims only limitation is 32K code size?
Regards, Deha
Any ideas?
Yes. Optimization. The code as shown gives the compiler the right to ignore the variable test.
Wow, it sounds loud and clear.
Thanx Fellas
Change your function in such way it returns 'test' and use the value returned by this function. See if it will generate similar code again