aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-02-09 10:16:38 +0100
committerRichard Biener <rguenther@suse.de>2024-02-12 14:36:25 +0100
commit938a419182f8c43bd1212ffb98f8aa6077cf8326 (patch)
tree6a8c53f2ec8bf6a093cd3d897e6b57e0890d03b9 /gcc/cp/constexpr.cc
parent0437cbdccb91da6a8c25b2c29e9f19a9585309fc (diff)
downloadgcc-938a419182f8c43bd1212ffb98f8aa6077cf8326.zip
gcc-938a419182f8c43bd1212ffb98f8aa6077cf8326.tar.gz
gcc-938a419182f8c43bd1212ffb98f8aa6077cf8326.tar.bz2
tree-optimization/113831 - wrong VN with structurally identical ref
When we use get_ref_base_and_extent during VN and that ends up using global ranges to restrict the range of a ref we have to take care of not using the same expression in the hashtable as for a ref that could not use that global range. The following attempts to ensure this by applying similar logic as get_ref_base_and_extent to copy_reference_ops_from_ref so they behave consistent. PR tree-optimization/113831 PR tree-optimization/108355 * tree-ssa-sccvn.cc (copy_reference_ops_from_ref): When we see variable array indices and get_ref_base_and_extent can resolve those to constants fix up the ops to constants as well. (ao_ref_init_from_vn_reference): Use 'off' member for ARRAY_REF and ARRAY_RANGE_REF instead of recomputing it. (valueize_refs_1): Also fixup 'off' of ARRAY_RANGE_REF. * gcc.dg/torture/pr113831.c: New testcase. * gcc.dg/tree-ssa/ssa-fre-104.c: Likewise.
Diffstat (limited to 'gcc/cp/constexpr.cc')
0 files changed, 0 insertions, 0 deletions