Commit fd48dc8
committed
Return
Comparing pointers from different blocks with `< <= > >=`
is undefined behavior in CompCert and in ISO C. So, it is sound to
analyze such comparisons as `Bnone`.
However, these comparisons occur in real code, and produce
statically-unpredictable Boolean results, so it is safer and more
consistent with other parts of the value analysis to return `Btop` in
non-strict mode.
Currently, this should make no difference to the generated code, since
CompCert does not optimize based on the absence of undefined
comparisons.Btop for undefined pointer comparisons in non-strict mode1 parent 18ecb24 commit fd48dc8
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
| 388 | + | |
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| |||
0 commit comments