diff options
author | Richard Biener <rguenther@suse.de> | 2024-05-16 12:35:28 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-05-16 14:44:17 +0200 |
commit | a9251ab3c91c8c559d0306838575a666ae62dff4 (patch) | |
tree | ef2e4e58b9e7d143a0876b1e338431239a66f7a3 /gcc/tree-ssa-structalias.cc | |
parent | 57f8a2f67c1536be23231808ab00613ab69193ed (diff) | |
download | gcc-a9251ab3c91c8c559d0306838575a666ae62dff4.zip gcc-a9251ab3c91c8c559d0306838575a666ae62dff4.tar.gz gcc-a9251ab3c91c8c559d0306838575a666ae62dff4.tar.bz2 |
wrong code with points-to and volatile
The following fixes points-to analysis which ignores the fact that
volatile qualified refs can result in any pointer.
* tree-ssa-structalias.cc (get_constraint_for_1): For
volatile referenced or decls use ANYTHING.
* gcc.dg/tree-ssa/alias-38.c: New testcase.
Diffstat (limited to 'gcc/tree-ssa-structalias.cc')
-rw-r--r-- | gcc/tree-ssa-structalias.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index bb59c6a..0bac1a1 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -3575,6 +3575,10 @@ get_constraint_for_1 (tree t, vec<ce_s> *results, bool address_p, } case tcc_reference: { + if (TREE_THIS_VOLATILE (t)) + /* Fall back to anything. */ + break; + switch (TREE_CODE (t)) { case MEM_REF: @@ -3676,6 +3680,9 @@ get_constraint_for_1 (tree t, vec<ce_s> *results, bool address_p, } case tcc_declaration: { + if (VAR_P (t) && TREE_THIS_VOLATILE (t)) + /* Fall back to anything. */ + break; get_constraint_for_ssa_var (t, results, address_p); return; } |