https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112380

--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sa...@gcc.gnu.org>:

https://gcc.gnu.org/g:624e274ca3a4405a55662fa72d1163120df0e03d

commit r14-6424-g624e274ca3a4405a55662fa72d1163120df0e03d
Author: Roger Sayle <ro...@nextmovesoftware.com>
Date:   Mon Dec 11 17:30:20 2023 +0000

    PR rtl-optimization/112380: Defend against CLOBBERs in combine.cc

    This patch addresses PR rtl-optimization/112380, an ICE-on-valid regression
    where a (clobber (const_int 0)) encounters a sanity checking gcc_assert
    (at line 7554) in simplify-rtx.cc.  These CLOBBERs are used internally
    by GCC's combine pass much like error_mark_node is used by various
    language front-ends.

    The solutions are either to handle/accept these CLOBBERs through-out
    (or in more places in) the middle-end's RTL optimizers, including functions
    in simplify-rtx.cc that are used by passes other than combine, and/or
    attempt to prevent these CLOBBERs escaping from try_combine into the
    RTX/RTL stream.  The benefit of the second approach is that it actually
    allows for better optimization: when try_combine fails to simplify an
    expression instead of substituting a CLOBBER to avoid the instruction
    pattern being recognized, noticing the CLOBBER often allows combine
    to attempt alternate simplifications/transformations looking for those
    that can be recognized.

    This first alternative is the minimal fix to address the CLOBBER
    encountered in the bugzilla PR.

    2023-12-11  Roger Sayle  <ro...@nextmovesoftware.com>

    gcc/ChangeLog
            PR rtl-optimization/112380
            * combine.cc (expand_field_assignment): Check if gen_lowpart
            returned a CLOBBER, and avoid calling gen_simplify_binary with
            it if so.

    gcc/testsuite/ChangeLog
            PR rtl-optimization/112380
            * gcc.dg/pr112380.c: New test case.
  • [Bug rtl-optimization/11238... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to