Skip to content
Snippets Groups Projects
Commit d564a83d authored by David Malcolm's avatar David Malcolm
Browse files

analyzer: make use of may_be_aliased in alias detection [PR103546]


Whilst debugging PR analyzer/103546 (false +ve in flex-generated lexers)
I noticed that the analyzer was considering that writes through symbolic
pointers could be treated as clobbering static globals such as:

   static YY_BUFFER_STATE * yy_buffer_stack = NULL;

even for such variables that never have their address taken.

This patch fixes this issue at least, so that the analyzer can preserve
knowledge of such globals on code paths with writes through symbolic
pointers.

It does not fix the false +ve in the lexer code.

gcc/analyzer/ChangeLog:
	PR analyzer/103546
	* store.cc (store::eval_alias_1): Refactor handling of decl
	regions, adding a test for may_be_aliased, rejecting those for
	which it returns false.

gcc/testsuite/ChangeLog:
	PR analyzer/103546
	* gcc.dg/analyzer/aliasing-3.c: New test.

Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
parent 8e277106
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