diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2016-03-02 10:35:21 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2016-03-02 10:35:21 +0100 |
commit | 513489eb97c2b99f5ad901a0f26b493e99bbec1a (patch) | |
tree | 42d5a8af0c7e5f56347bc668386eedb32428201f /test/regression/sizeof2.c | |
parent | d8740a489984f63864a8e4ff728fb7f3871ecb34 (diff) | |
download | compcert-513489eb97c2b99f5ad901a0f26b493e99bbec1a.tar.gz compcert-513489eb97c2b99f5ad901a0f26b493e99bbec1a.zip |
Make casts of pointers to _Bool semantically well defined (again).
In compCert 2.5 the semantics of pointer comparisons against the NULL pointer was made more accurate by making it undefined if the pointer is invalid (outside bounds). Technical difficulties prevented this change from being propagated to the semantics of casts from pointer types to the _Bool type, which involves an implicit pointer comparison against NULL. Hence, this kind of casts was temporarily given undefined semantics.
This commit makes pointer-to-_Bool casts semantically defined (again), provided the pointer is valid. This reinstates the equivalence between casts to _Bool and comparisons != 0. The technical difficulties mentioned above came from the translation of assignments in a value context in the SimplExpr pass. The pass was lightly modified to work around the issue.
Diffstat (limited to 'test/regression/sizeof2.c')
0 files changed, 0 insertions, 0 deletions