[Bug rtl-optimization/125209] [16 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu: in simplify_subreg, at simplify-rtx.cc:8365

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125209

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Richard Biener
<[email protected]>:

https://gcc.gnu.org/g:8b146837cefcee5955687879a60fb6aa8accc11d

commit r16-9384-g8b146837cefcee5955687879a60fb6aa8accc11d
Author: Boudewijn van der Heide <[email protected]>
Date:   Sun May 10 21:46:48 2026 -0600

    [PATCH] combine: Check against CLOBBER in make_compound_operation_int
[PR125209]

    In combine_simplify_rtx, CLOBBER can be returned, which is propagated to
    make_compound_operation.  When make_compound_operation_int then calls
    simplify_subreg, it triggers a gcc_assert, because the mode is neither
inner,
    nor void. This results in an ICE.

    We fix this by checking if we got CLOBBER before calling simplify_subreg
from
    make_compound_operation and bail out; we return NULL_RTX.

    Testcase from the bug report by Zhendong Su.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR rtl-optimization/125209

    gcc/
            * combine.cc (make_compound_operation_int): Return NULL_RTX if we
got CLOBBER.

    gcc/testsuite/
            * gcc.dg/pr125209.c: New test.

    Signed-off-by: Boudewijn van der Heide <[email protected]>
    (cherry picked from commit a33f80c6ed06037bd1d31680ae3152e362931f51)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.