From f3e5f4c58591f5dacdd14a65ec47bbe310df02a0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 11 Mar 2024 11:17:32 +0100 Subject: tree-optimization/13962 - handle ptr-ptr compares in ptrs_compare_unequal Now that we handle pt.null conservatively we can implement the missing tracking of constant pool entries (aka STRING_CST) and handle ptr-ptr compares using points-to info in ptrs_compare_unequal. PR tree-optimization/13962 PR tree-optimization/96564 * tree-ssa-alias.h (pt_solution::const_pool): New flag. * tree-ssa-alias.cc (ptrs_compare_unequal): Handle pointer-pointer compares. (dump_points_to_solution): Dump the const_pool flag, fix guard of flag dumping. * gimple-pretty-print.cc (pp_points_to_solution): Likewise. * tree-ssa-structalias.cc (find_what_var_points_to): Set the const_pool flag for STRING. (pt_solution_ior_into): Handle the const_pool flag. (ipa_escaped_pt): Initialize it. * gcc.dg/tree-ssa/alias-39.c: New testcase. * g++.dg/vect/pr68145.cc: Use -fno-tree-pta to avoid UB to manifest in transforms no longer vectorizing this testcase for an ICE. --- gcc/tree-ssa-alias.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/tree-ssa-alias.h') diff --git a/gcc/tree-ssa-alias.h b/gcc/tree-ssa-alias.h index b26fffe..e29dff5 100644 --- a/gcc/tree-ssa-alias.h +++ b/gcc/tree-ssa-alias.h @@ -47,6 +47,11 @@ struct GTY(()) pt_solution includes memory at address NULL. */ unsigned int null : 1; + /* Nonzero if the points-to set includes a readonly object like a + STRING_CST that does not have an underlying declaration but will + end up in the constant pool. */ + unsigned int const_pool : 1; + /* Nonzero if the vars bitmap includes a variable included in 'nonlocal'. */ unsigned int vars_contains_nonlocal : 1; /* Nonzero if the vars bitmap includes a variable included in 'escaped'. */ -- cgit v1.1