[Bug debug/99830] [11 Regression] ICE: in lra_eliminate_regs_1, at lra-eliminations.c:659 with -O2 -fno-expensive-optimizations -fno-split-wide-types -g

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 20 09:46:09 GMT 2021


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

--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:4ac7483ede91fef7cfd548ff6e30e46eeb9d95ae

commit r10-9726-g4ac7483ede91fef7cfd548ff6e30e46eeb9d95ae
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Apr 13 01:00:48 2021 +0200

    combine: Don't fold away side-effects in simplify_and_const_int_1 [PR99830]

    Here is an alternate patch for the PR99830 bug.
    As discussed on IRC and in the PR, the reason why a (clobber:TI (const_int
0))
    has been propagated into the debug insns is that it got optimized away
    during simplification from the i3 instruction pattern.

    And that happened because
    simplify_and_const_int_1 (SImode, varop, 255)
    with varop of
    (ashift:SI (subreg:SI (and:TI (clobber:TI (const_int 0 [0]))
                                  (const_int 255 [0xff])) 0)
               (const_int 16 [0x10]))
    was called and through nonzero_bits determined that (whatever << 16) & 255
    is const0_rtx.
    It is, but if there are side-effects in varop and such clobbers are
    considered as such, we shouldn't optimize those away.

    2021-04-13  Jakub Jelinek  <jakub@redhat.com>

            PR debug/99830
            * combine.c (simplify_and_const_int_1): Don't optimize varop
            away if it has side-effects.

            * gcc.dg/pr99830.c: New test.

    (cherry picked from commit 9c1c8ad8339d551ac91a7af5614f29b9a687189a)


More information about the Gcc-bugs mailing list