aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl-ssa
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2024-07-22 16:42:16 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2024-07-22 16:42:16 +0100
commit34f33ea801563e2eabb348e8d3e9344a91abfd48 (patch)
tree59dbfafcc960cd54e554c89836a1277079be4efc /gcc/rtl-ssa
parente62988b77757c6019f0a538492e9851cda689c2e (diff)
downloadgcc-34f33ea801563e2eabb348e8d3e9344a91abfd48.zip
gcc-34f33ea801563e2eabb348e8d3e9344a91abfd48.tar.gz
gcc-34f33ea801563e2eabb348e8d3e9344a91abfd48.tar.bz2
rtl-ssa: Avoid using a stale splay tree root [PR116009]
In the fix for PR115928, I'd failed to notice that "root" was used later in the function, so needed to be updated. gcc/ PR rtl-optimization/116009 * rtl-ssa/accesses.cc (function_info::add_def): Set the root local variable after removing the old clobber group. gcc/testsuite/ PR rtl-optimization/116009 * gcc.c-torture/compile/pr116009.c: New test.
Diffstat (limited to 'gcc/rtl-ssa')
-rw-r--r--gcc/rtl-ssa/accesses.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rtl-ssa/accesses.cc b/gcc/rtl-ssa/accesses.cc
index c77a1ff..0bba839 100644
--- a/gcc/rtl-ssa/accesses.cc
+++ b/gcc/rtl-ssa/accesses.cc
@@ -946,7 +946,8 @@ function_info::add_def (def_info *def)
prev = split_clobber_group (group, insn);
next = prev->next_def ();
tree.remove_root ();
- last->set_splay_root (tree.root ());
+ root = tree.root ();
+ last->set_splay_root (root);
}
// COMPARISON is < 0 if DEF comes before ROOT or > 0 if DEF comes
// after ROOT.