]> gcc.gnu.org Git - gcc.git/commit
rtl-ssa: Fix split_clobber_group [PR115928]
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 17 Jul 2024 18:38:11 +0000 (19:38 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 17 Jul 2024 18:38:11 +0000 (19:38 +0100)
commit71b31690a7c52413496e91bcc5ee4c68af2f366f
treee80201cdbfc1e6223f0adbf2dff2bde4763832f6
parentb19906a029a059fc5015046bae60e3287d842bba
rtl-ssa: Fix split_clobber_group [PR115928]

One of the goals of the rtl-ssa representation was to allow a
group of consecutive clobbers to be skipped in constant time,
with amortised sublinear insertion and deletion.  This involves
putting consecutive clobbers in groups.  Splitting or joining
groups would be linear if we had to update every clobber on
each update, so the operation to query a clobber's group is
lazy and (again) amortised sublinear.

This means that, when splitting a group into two, we cannot
reuse the old group for one side.  We have to invalidate it,
so that the lazy clobber_info::group query can tell that something
has changed.  The ICE in the PR came from failing to do that.

gcc/
PR rtl-optimization/115928
* rtl-ssa/accesses.h (clobber_group): Add a new constructor that
takes the first, last and root clobbers.
* rtl-ssa/internals.inl (clobber_group::clobber_group): Define it.
* rtl-ssa/accesses.cc (function_info::split_clobber_group): Use it.
Allocate a new group for both sides and invalidate the previous group.
(function_info::add_def): After calling split_clobber_group,
remove the old group from the splay tree.

gcc/testsuite/
PR rtl-optimization/115928
* gcc.dg/torture/pr115928.c: New test.
gcc/rtl-ssa/accesses.cc
gcc/rtl-ssa/accesses.h
gcc/rtl-ssa/internals.inl
gcc/testsuite/gcc.dg/torture/pr115928.c [new file with mode: 0644]
This page took 0.060601 seconds and 5 git commands to generate.