]> git.ipfire.org Git - thirdparty/gcc.git/commit
pair-fusion: Add singleton move_range asserts [PR114492]
authorAlex Coplan <alex.coplan@arm.com>
Wed, 5 Mar 2025 15:45:09 +0000 (15:45 +0000)
committerAlex Coplan <alex.coplan@arm.com>
Thu, 6 Mar 2025 11:37:00 +0000 (11:37 +0000)
commitd6d7da92fb598c50d25332011bffe6b6515c9669
tree8c78f08940570b44c286155b95ec60a19271d7c1
parentde231924b73bc120bf2b7ada4eeccd884c249ee1
pair-fusion: Add singleton move_range asserts [PR114492]

The PR claims that pair-fusion has invalid uses of gcc_assert (such that
the pass will misbehave with --disable-checking).  As noted in the
comments, in the case of the calls to restrict_movement, the only way we
can possibly depend on the side effects is if we call it with a
non-singleton move range.  However, the intent is that we always have a
singleton move range here, and thus we do not rely on the side effects.

This patch therefore adds asserts to check for a singleton move range
before calling restrict_movement, thus clarifying the intent and
hopefully dispelling any concerns that having the calls wrapped in
asserts is problematic here.

gcc/ChangeLog:

PR rtl-optimization/114492
* pair-fusion.cc (pair_fusion_bb_info::fuse_pair): Check for singleton
move range before calling restrict_movement.
(pair_fusion::try_promote_writeback): Likewise.
gcc/pair-fusion.cc