Frama-C-discuss mailing list archives
This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Frama-c-discuss] recursive calls in value analysis
- Subject: [Frama-c-discuss] recursive calls in value analysis
- From: pascal.cuoq at gmail.com (Pascal Cuoq)
- Date: Wed, 20 Apr 2011 18:08:58 +0200
- In-reply-to: <7266_1303310693_4DAEF165_7266_122_5_12615CBFF54930468079CF80A7B135533612FE87FB@DE0-MAILMBX-P13.res.airbus.corp>
- References: <7266_1303310693_4DAEF165_7266_122_5_12615CBFF54930468079CF80A7B135533612FE87FB@DE0-MAILMBX-P13.res.airbus.corp>
> I use the -ignore-recursive-calls option as recommended but it doesn?t work. This wouldn't do what you want anyway, unless what you want is to assume that the inner call to cmd_help does nothing. And if this is what you want, you can simply cut the unimportant recursive functions, or just the unimportant recursive calls, out of the analyzed code. > Does somebody know how I can fix it? You are in a bit of a worst case. This is indirect recursion, going through three intermediate functions. A workaround that would only work if the recursion is very shallow (and still require a lot of work) would be to duplicate function cmd_help() in as many version as you need: cmd_help_0, cmd_help_1, cmd_help_2, ..., list pointers to these functions in an array, and use a macro to replace calls to cmd_help(...) by: (cmd_help_array[cmd_help_counter++])(...); cmd_help_counter--; This would effectively erase the recursion from the program while preserving the meaning. If cmd_help() calls other functions again (such as command_foreach()), you may have to apply the same transformation to these other functions, too. But the worst part is that you must force the analysis to compute precise values for all the function_counter variables at all times. So, in short, it will probably never work and I can't recommend trying it. The value analysis currently assumes that each local variable appears only once in the call stack. This is what prevents recursion from being handled. Removing this limitation for programs with obviously bounded recursion (the value analysis has to be able to see that it is bounded) could be CEA LIST's contribution to a scientific collaboration, but meanwhile, it is not on the roadmap. I have not thought much about non-obviously-bounded recursion, but that would take us rather far from the value analysis' original mission of being a general-purpose automatic analyzer for embedded C code. Pascal
- References:
- [Frama-c-discuss] recursive calls in value analysis
- From: sali.sene at airbus.com (SENE, Sali)
- [Frama-c-discuss] recursive calls in value analysis
- Prev by Date: [Frama-c-discuss] recursive calls in value analysis
- Next by Date: [Frama-c-discuss] frama-gui question
- Previous by thread: [Frama-c-discuss] recursive calls in value analysis
- Next by thread: [Frama-c-discuss] recursive calls in value analysis
- Index(es):