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

Code size Increased Unreasonably!

Hi Everyone,

I'm using C251 compiler with optimization level 9 with 'size' emphasis. I've a function similar to one given below.

int * fun(short* param1, Boolean param2){

//..........code goes here
}

This function is being called as fun(someValue,TRUE) or fun(someValue, FALSE) across the souce code. I tried to replace these calls with the help of two new functions that knows beforehand second argument. This change was based on calling convention used by C251.
I assumed that C251 passes parameters similarly as C51,i.e. by using registers and memory locations (hence boolean parameter need not be passed at all).

Warpper functions are given below.

int * funTRUE(short* param){

return fun(param,TRUE);
}

int * funFALSE(short* param){

return fun(param,FALSE);
}

After this change code size has increased by around 3K rather than went down. Replacement are around 20 so we can not say that code of wrapper functions have added to increase in the code size more than reduction due to call replacements with calls to wrapper functions.
How can I've more insight in this phenomenon?

Parents
  • Why use the Bold tag for your code instead of the tag that is provided specifically for source code?!

    "I assumed that C251 passes parameters similarly as C51"

    You must absolutely not go making assumptions like that - you must study the manuals to obtain such information.

    "How can I've more insight in this phenomenon"

    Stop making assumptions - confirm things in the documentation;

    Look at the Map file to see where the additional code size is actually appearing;

    Look at the generated code.

Reply
  • Why use the Bold tag for your code instead of the tag that is provided specifically for source code?!

    "I assumed that C251 passes parameters similarly as C51"

    You must absolutely not go making assumptions like that - you must study the manuals to obtain such information.

    "How can I've more insight in this phenomenon"

    Stop making assumptions - confirm things in the documentation;

    Look at the Map file to see where the additional code size is actually appearing;

    Look at the generated code.

Children