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: David Malcolm <dmalcolm@redhat.com>