This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil5 compiler issue

Since I use level 3 (-O3) optimization in keil5,it is irrelevant with the with the value of the sentence

 " !IS_POOL_ALIGNED(pPool, OS_MEM_POOL_BASE_ALIGN) ",

the judgement  "if (!IS_POOL_ALIGNED(pPool, OS_MEM_POOL_BASE_ALIGN))" is always true,

so I always get "return LOS_NOK"

But if I use level 0 (-O0) , every thing is fun, why?

 if (!IS_POOL_ALIGNED(pPool, OS_MEM_POOL_BASE_ALIGN))
        return LOS_NOK;

Parents
  • Reads as FINE

    Basically complaint that optimization setting folds code, suggesting some other latent issue with the code.

    Need to review the functions and macro expansions more critically to understand why the compiler comes to this conclusion. Insufficient code presented for us to see. Try harder, dig deeper..

Reply
  • Reads as FINE

    Basically complaint that optimization setting folds code, suggesting some other latent issue with the code.

    Need to review the functions and macro expansions more critically to understand why the compiler comes to this conclusion. Insufficient code presented for us to see. Try harder, dig deeper..

Children
No data