aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-03-29 09:01:23 -0700
committerIan Lance Taylor <iant@golang.org>2023-03-29 09:01:23 -0700
commit6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced (patch)
tree1deecdcfbf185c7044bc861d0ace51285c96cb62 /gcc/tree-ssa-structalias.cc
parent795cffe109e28b248a54b8ee583cbae48368c2a7 (diff)
parentaa8f4242efc99f24de73c59d53996f28db28c13f (diff)
downloadgcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.zip
gcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.tar.gz
gcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.tar.bz2
Merge from trunk revision aa8f4242efc99f24de73c59d53996f28db28c13f.
Diffstat (limited to 'gcc/tree-ssa-structalias.cc')
-rw-r--r--gcc/tree-ssa-structalias.cc25
1 files changed, 16 insertions, 9 deletions
diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc
index dcf13d9..c3c5bce 100644
--- a/gcc/tree-ssa-structalias.cc
+++ b/gcc/tree-ssa-structalias.cc
@@ -1,5 +1,5 @@
/* Tree based points-to analysis
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
Contributed by Daniel Berlin <dberlin@dberlin.org>
This file is part of GCC.
@@ -2775,8 +2775,15 @@ solve_graph (constraint_graph_t graph)
continue;
/* If the node has changed, we need to process the
- complex constraints and outgoing edges again. */
- if (bitmap_clear_bit (changed, i))
+ complex constraints and outgoing edges again. For complex
+ constraints that modify i itself, like the common group of
+ callarg = callarg + UNKNOWN;
+ callarg = *callarg + UNKNOWN;
+ *callarg = callescape;
+ make sure to iterate immediately because that maximizes
+ cache reuse and expands the graph quickest, leading to
+ better visitation order in the next iteration. */
+ while (bitmap_clear_bit (changed, i))
{
unsigned int j;
constraint_t c;
@@ -2794,7 +2801,7 @@ solve_graph (constraint_graph_t graph)
??? But we shouldn't ended up with "changed" set ... */
if (vi->oldsolution
&& bitmap_bit_p (vi->oldsolution, anything_id))
- continue;
+ break;
bitmap_copy (pts, get_varinfo (find (anything_id))->solution);
}
else if (vi->oldsolution)
@@ -2803,7 +2810,7 @@ solve_graph (constraint_graph_t graph)
bitmap_copy (pts, vi->solution);
if (bitmap_empty_p (pts))
- continue;
+ break;
if (vi->oldsolution)
bitmap_ior_into (vi->oldsolution, pts);
@@ -4408,17 +4415,17 @@ handle_lhs_call (gcall *stmt, tree lhs, int flags, vec<ce_s> &rhsc,
&& (flags & ERF_RETURN_ARG_MASK) < gimple_call_num_args (stmt))
{
tree arg;
- rhsc.create (0);
+ rhsc.truncate (0);
arg = gimple_call_arg (stmt, flags & ERF_RETURN_ARG_MASK);
get_constraint_for (arg, &rhsc);
process_all_all_constraints (lhsc, rhsc);
- rhsc.release ();
+ rhsc.truncate (0);
}
else if (flags & ERF_NOALIAS)
{
varinfo_t vi;
struct constraint_expr tmpc;
- rhsc.create (0);
+ rhsc.truncate (0);
vi = make_heapvar ("HEAP", true);
/* We are marking allocated storage local, we deal with it becoming
global by escaping and setting of vars_contains_escaped_heap. */
@@ -4435,7 +4442,7 @@ handle_lhs_call (gcall *stmt, tree lhs, int flags, vec<ce_s> &rhsc,
tmpc.type = ADDRESSOF;
rhsc.safe_push (tmpc);
process_all_all_constraints (lhsc, rhsc);
- rhsc.release ();
+ rhsc.truncate (0);
}
else
process_all_all_constraints (lhsc, rhsc);