Handle failure to determine pointer provenance conservatively [PR104069].
authorMartin Sebor <msebor@redhat.com>
Wed, 19 Jan 2022 00:52:01 +0000 (17:52 -0700)
committerMartin Sebor <msebor@redhat.com>
Wed, 19 Jan 2022 01:04:08 +0000 (18:04 -0700)
commit2f714642e574c64e1c0e093cad3de6f8accb6ec7
tree3b58a833770c73a30999f0e5ab924a54ae2703bb
parent9c186493a7cc1c911910b9c37220334f9529912d
Handle failure to determine pointer provenance conservatively [PR104069].

Partly resolves:
PR middle-end/104069 - -Werror=use-after-free false positive on elfutils-0.186

gcc/ChangeLog:
PR middle-end/104069
* gimple-ssa-warn-access.cc (pointers_related_p): Return false for
an unknown result as documented.

gcc/testsuite/ChangeLog:
PR middle-end/104069
* gcc.dg/Wuse-after-free.c: New test.
gcc/gimple-ssa-warn-access.cc
gcc/testsuite/gcc.dg/Wuse-after-free.c [new file with mode: 0644]