gimple: Ignore *0 = {CLOBBER} in path isolation [PR96722]
authorJakub Jelinek <jakub@redhat.com>
Tue, 25 Aug 2020 11:49:40 +0000 (13:49 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 25 Aug 2020 11:49:40 +0000 (13:49 +0200)
commita5b15fcb954ba63d58f0daa700281aba33b5f24a
tree981c1d7a4dbd26ef6e327e9e4e6daec6ab0c18f4
parentf982a6ec9b6d98f5f37114b1d7455c54ce5056b8
gimple: Ignore *0 = {CLOBBER} in path isolation [PR96722]

Clobbers of MEM_REF with NULL address are just fancy nops, something we just
ignore and don't emit any code for it (ditto for other clobbers), they just
mark end of life on something, so we shouldn't infer from those that there
is some UB.

2020-08-25  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/96722
* gimple.c (infer_nonnull_range): Formatting fix.
(infer_nonnull_range_by_dereference): Return false for clobber stmts.

* g++.dg/opt/pr96722.C: New test.
gcc/gimple.c
gcc/testsuite/g++.dg/opt/pr96722.C [new file with mode: 0644]