Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • F frama-c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 209
    • Issues 209
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pub
  • frama-c
  • Issues
  • #2491

Closed
Open
Created Jul 24, 2009 by mantis-gitlab-migration@mantis-gitlab-migration

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;

}

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking