]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/100923 - fix alias-ref construction wrt availability
authorRichard Biener <rguenther@suse.de>
Tue, 8 Jun 2021 10:52:12 +0000 (12:52 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 17 Feb 2022 09:28:44 +0000 (10:28 +0100)
commita650dc2deb2b6906334c6b06991255f46df93c16
tree27bee782673256b474ec032c8076d7305384bdc0
parent578bc9d1cdd91694e4da393d32f0fddd213a6042
tree-optimization/100923 - fix alias-ref construction wrt availability

This PR shows that building an ao_ref from value-numbers is prone to
expose bogus contextual alias info to the oracle.  The following makes
sure to construct ao_refs from SSA names available at the program point
only.

On the way it modifies the awkward valueize_refs[_1] API.

2021-06-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/100923
* tree-ssa-sccvn.c (valueize_refs_1): Take a pointer to
the operand vector to be valueized.
(valueize_refs): Likewise.
(valueize_shared_reference_ops_from_ref): Adjust.
(valueize_shared_reference_ops_from_call): Likewise.
(vn_reference_lookup_3): Likewise.
(vn_reference_lookup_pieces): Likewise.  Re-valueize
with honoring availability when we are about to create
the ao_ref and valueized before.
(vn_reference_lookup): Likewise.
(vn_reference_insert_pieces): Adjust.

* gcc.dg/torture/pr100923.c: New testcase.

(cherry picked from commit 7a56d3d3e99cc77ad8a6a674870c814da6225675)
gcc/testsuite/gcc.dg/torture/pr100923.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c