Value Range Analysis of source code variables

Theodoros Theodoridis theodoros.theodoridis@inf.ethz.ch
Mon May 30 14:08:29 GMT 2022


Hello,

is there a way to query the value range analysis results for source-code 
level variables?
For example, given the following piece of code:

|static int a = 0; int main(){ int b = 42; if (b > 0){ a = 2; } b = 1; 
return 0; } |

Is there a way to “ask” gcc what the value ranges (or sets) of |a| and 
|b| are?
The result would be, assuming gcc can figure this out, |a = {0,2}| and 
|b = {1, 42}| or |a in [0,2]| and |b in [1,42]|.

Thanks,
Theo


More information about the Gcc-help mailing list