OPtimization of constants with keil

In my code I have many of constants have same value. I cannot use same name of constant due to logic.

On optimization will keil take different memory of each or same memory.

I am using three setting of optimization:
1. O0
2. Cross + microlib + O2
3. Cross + Time + O3

Parents
  • I'm not sure I understand the question, but: the memory location of your constants will be different with each optimization setting, unless you use an attribute to place them at a specific address.

    And the compiler will never "merge" constants that happen to have the same value.

Reply
  • I'm not sure I understand the question, but: the memory location of your constants will be different with each optimization setting, unless you use an attribute to place them at a specific address.

    And the compiler will never "merge" constants that happen to have the same value.

Children
No data
More questions in this forum