Slicing removes more code than it should
ID0000201:
**This issue was created automatically from Mantis Issue 201. Further discussion may take place here.**
---
| **Id** | **Project** | **Category** | **View** | **Due Date** | **Updated** |
| --- | --- | --- | --- | --- | --- |
| ID0000201 | Frama-C | Plug-in > slicing | public | 2009-07-24 | 2009-07-24 |
| | | | | | |
| --- | --- | --- | --- | --- | --- |
| **Reporter** | lukaszc | **Assigned To** | Anne | **Resolution** | no change required |
| **Priority** | normal | **Severity** | major | **Reproducibility** | always |
| **Platform** | - | **OS** | - | **OS Version** | - |
| **Product Version** | Frama-C Beryllium-20090601-beta1 | **Target Version** | - | **Fixed in Version** | - |
### Description :
Slicing removes more code than it should leading to erronous results.
In the example below I wanted to leave the code which influences value of temp in fun(). To this end I used the following command. However, the obtained result (no slicing errors were indicated) presented below is not equivalnet to the input.
command-----------------------------------------------
frama-c -slice-print -slice-value temp -slicing-level 3 -main fun -lib-entry -pp-annot temp.c -ocode temp2.c
input-----------------------------------------------
#define arr *(unsigned char *)
#define Alarm1_On {arr(0) |= 0;}
#define Alarm1_Off {arr(0) |= 0;}
int temp;
int temp2;
void fun()
{
temp = 2;
fun2();
}
void fun2()
{
if (temp2)
{
temp = 0;
Alarm1_Off;
}
else
{
temp = 1;
Alarm1_On;
}
}
output----------------------------------------------
/* Generated by CIL v. 1.3.6 */
/* print_CIL_Input is false */
void fun(void)
{
return;
}
issue