Frama-C Bug Tracking System

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000325Frama-CPlug-in > Evapublic2009-11-07 12:052014-02-12 16:55
Reporterpascal 
Assigned Topascal 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionFrama-C Beryllium-20090902 
Target VersionFixed in VersionFrama-C Boron-20100401 
Summary0000325: Precise widening when a loop condition involves a char or short
Description > Depending the type of i, the range is not the same. > The range of i in the loop is [0..10] (for int) or [0..15] for char or > short. _____ void main(void) { char i=0; int j=0; while (i<10) i++; while (j<10) j++; } [value] ====== VALUES COMPUTED ====== [value] Values for function main: i IN {10; 11; 12; 13; 14; 15; } j IN {10; } _____ Note that the AST for the two loops is different: i = (char)0; j = 0; while ((int )i < 10) {i = (char )((int )i + 1);} while (j < 10) {j ++;} CIL transforms the code thus because the standard specifies that operators such as ++ do not operate on types smaller than int, and that values of these types are implicitly promoted to int in these conditions. Meanwhile, in the absence of any loop-related option, the value analysis tries to keep computations short at the price of precision by using a technique called "widening". In order to limit the loss of precision, however, various heuristics are used, including a syntactic one for the j loop that recognizes that j IN [0..10] is a good candidate for the loop invariant. These heuristic does not currently recognize the condition ((int )i < 10) as one where it would be valuable to try the same kind of invariant.
TagsNo tags attached.
Attached Files

- Relationships
has duplicate 0000414closedpascal imprecision in widening/narrowing for char and short index 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2009-11-07 12:05 pascal New Issue
2009-11-07 12:05 pascal Status new => assigned
2009-11-07 12:05 pascal Assigned To => pascal
2010-02-19 14:46 pascal Relationship added has duplicate 0000414
2010-02-19 16:09 svn Checkin
2010-02-19 16:09 svn Status assigned => resolved
2010-02-19 16:09 svn Resolution open => fixed
2010-04-13 15:30 signoles Status resolved => new
2010-04-13 15:31 signoles Status new => closed
2010-04-13 15:33 signoles Fixed in Version => Frama-C Boron
2018-01-12 14:26 signoles Category Plug-in > value analysis => Plug-in > Eva


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker