]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/116785 - relax volatile handling in PTA
authorRichard Biener <rguenther@suse.de>
Fri, 27 Sep 2024 11:50:31 +0000 (13:50 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 30 Sep 2024 05:41:04 +0000 (07:41 +0200)
When there's volatile qualified stores we do not have to treat the
destination as pointing to ANYTHING.  It's only when reading from
it that we want to treat the resulting pointers as pointing to ANYTHING.

PR tree-optimization/116785
* tree-ssa-structalias.cc (get_constraint_for_1): Only
volatile qualified reads produce ANYTHING.

gcc/tree-ssa-structalias.cc

index d6a53f801f036fd1bbe2586e102a1c3517e199bb..54c4818998d84a990b7e52b80258198e2646bf47 100644 (file)
@@ -3646,7 +3646,7 @@ get_constraint_for_1 (tree t, vec<ce_s> *results, bool address_p,
       }
     case tcc_reference:
       {
-       if (TREE_THIS_VOLATILE (t))
+       if (!lhs_p && TREE_THIS_VOLATILE (t))
          /* Fall back to anything.  */
          break;
 
@@ -3751,7 +3751,7 @@ get_constraint_for_1 (tree t, vec<ce_s> *results, bool address_p,
       }
     case tcc_declaration:
       {
-       if (VAR_P (t) && TREE_THIS_VOLATILE (t))
+       if (!lhs_p && VAR_P (t) && TREE_THIS_VOLATILE (t))
          /* Fall back to anything.  */
          break;
        get_constraint_for_ssa_var (t, results, address_p);