On 7/16/24 8:24 AM, Richard Sandiford wrote:
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.

Tested on aarch64-linux-gnu & x86_64-linux-gnu.  OK to install?

Richard


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.
OK
jeff

Reply via email to