[Bug rtl-optimization/114492] [14/15 Regression] Invalid use of gcc_assert (notably in gcc/config/aarch64/aarch64-ldp-fusion.cc)
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 6 11:40:06 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114492
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alex Coplan <acoplan@gcc.gnu.org>:
https://gcc.gnu.org/g:d6d7da92fb598c50d25332011bffe6b6515c9669
commit r15-7854-gd6d7da92fb598c50d25332011bffe6b6515c9669
Author: Alex Coplan <alex.coplan@arm.com>
Date: Wed Mar 5 15:45:09 2025 +0000
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.
More information about the Gcc-bugs
mailing list