alibaba
19th December 2021, 07:55
Hi experts:
I created a library in IVc4. During normal compilation, there is no error message. But when selecting "Compile + Debug", this kind of error occurred:

Fatal Error : Function 'XXXXXXX' too large.

I searched the forum, but did not see anything similar to mine.I checked the "known limits" section in ivc4 manual, and I don't know if the "maximum branch of BIC." limit has been exceeded. It says this:

- maximum BRANCH of 32K
BRANCH means the part of generated object code per function,including macros etc.

If this is the case, then I don't understand why the error is reported only when "Compile + Debug", but everything is normal when compiling.
If debugging is not possible, the library cannot be used. So how should I solve this problem? Split this function?

Thanks.

mark_h
19th December 2021, 15:51
I am not familiar with that error. Probably what I would do is first comment out the function and try compile + debug again. See if I got a new error. Then I would probably start looking at the function and maybe just commenting out pieces of it. I am not sure what maybe the cause of the error. Maybe post the function here and maybe someone can see something wrong with it.

alibaba
19th December 2021, 18:46
Thank you very much for your suggestion Mark. and sorry that my code is too long to post on the forum. My function is a CASE structure with 20 branches. After adding a new branch today, the aforementioned error occurred.
As you said, if I comment out the newly added part of the code, no error will be reported when compile + debug. I think may have reached the memory limit of a single function base on current BIC. Now I split the function and moved some processing units out of the function. Now I no longer report errors when compile + debug. Thank you again for your timely help every time.

bdittmar
20th December 2021, 10:35
Hello,

Fatal error: Function '<function>' too large - when compiling in Debugger
Functions have the following constraints: Maximum 255 arguments per function
Maximum 32K variables per compilation
Maximum BRANCH of 32K (BRANCH refers...function (branch)....
The 32k branch limit is what is encountered in this case.
Compiling in debug mode adds extra information
Artikel-ID: 1154423

Regards

alibaba
20th December 2021, 16:46
Thank you for your help bdittmar