-
- Downloads
tree-optimization/109123 - run -Wuse-afer-free only early
The following switches the -Wuse-after-free diagnostics from emitted during the late access warning passes to the early access warning passes to make sure we run before passes performing code motion run which are the source of a lot of false positives on use-after-free not involving memory operations. The patch also fixes an issue in c-c++-common/Wuse-after-free-6.c and causes the name of the unused pointer to appear in the diagnostic for extra cases in gcc.dg/Wuse-after-free-2.c PR tree-optimization/109123 * gimple-ssa-warn-access.cc (pass_waccess::warn_invalid_pointer): Do not emit -Wuse-after-free late. (pass_waccess::check_call): Always check call pointer uses. * gcc.dg/Wuse-after-free-pr109123.c: New testcase. * gcc.dg/Wuse-after-free-2.c: Amend expected diagnostic with the name of the pointer. * c-c++-common/Wuse-after-free-6.c: Un-XFAIL case.
Showing
- gcc/gimple-ssa-warn-access.cc 14 additions, 14 deletionsgcc/gimple-ssa-warn-access.cc
- gcc/testsuite/c-c++-common/Wuse-after-free-6.c 1 addition, 1 deletiongcc/testsuite/c-c++-common/Wuse-after-free-6.c
- gcc/testsuite/gcc.dg/Wuse-after-free-2.c 4 additions, 4 deletionsgcc/testsuite/gcc.dg/Wuse-after-free-2.c
- gcc/testsuite/gcc.dg/Wuse-after-free-pr109123.c 41 additions, 0 deletionsgcc/testsuite/gcc.dg/Wuse-after-free-pr109123.c
Loading
Please register or sign in to comment