[Bug middle-end/126497] ICE with bitint(1) and comparisons

"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=126497

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

https://gcc.gnu.org/g:dc9852f32b7b7f072fadc3fe99efec464ff81fc4

commit r16-9478-gdc9852f32b7b7f072fadc3fe99efec464ff81fc4
Author: Jakub Jelinek <[email protected]>
Date:   Fri Jul 31 09:05:50 2026 +0200

    gimplify: Allow declarations in recalculate_side_effects [PR126497]

    The following testcase ICEs, because we decide to fold a comparison
    into just one of its operands, we call recalculate_side_effects on that
    and ICE on the assertion that it isn't called on anything unexpected
    (here PARM_DECL).
    Already some time ago we had to add an exception for SSA_NAME for the
    same reason.
    The tcc_declaration case is slightly different, TREE_SIDE_EFFECTS is
    sometimes present on those if they are TREE_THIS_VOLATILE, but it is
    something the FE should take care of when creating those decls, not
    a business of the gimplifier.

    2026-07-31  Jakub Jelinek  <[email protected]>

            PR middle-end/126497
            * gimplify.cc (recalculate_side_effects): Return for
            tcc_declaration.

            * gcc.dg/bitint-141.c: New test.

    Reviewed-by: Andrea Pinski <[email protected]>
    (cherry picked from commit ca867fd9d5ace4ede8289dba9ae731e554bde618)
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.