Skip to content
Snippets Groups Projects
Commit 0a07bfad authored by Richard Biener's avatar Richard Biener
Browse files

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.
parent adb70c2d
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment