[Bug rtl-optimization/102478] [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 21 10:18:02 GMT 2022


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

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

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

commit r12-6786-gc2d9159717b474f9c06dde4d32b48b87164deb50
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jan 21 11:16:50 2022 +0100

    optabs: Don't create pseudos in prepare_cmp_insn when not allowed
[PR102478]

    cond traps can be created during ce3 after reload (and e.g. PR103028
    recently fixed some ce3 cond trap related bug, so I think often that
    works fine and we shouldn't disable cond traps after RA altogether),
    but it calls prepare_cmp_insn.  This function can fail, so I don't
    see why we couldn't make it work after RA (in most cases it already
    just works).  The first hunk is just an optimization which doesn't
    make sense after RA, so I've guarded it with can_create_pseudo_p.
    The second hunk is just a theoretical case, I don't have a testcase for it.
    prepare_cmp_insn has some other spots that can create pseudos, like when
    both operands have VOIDmode, or when it is BLKmode comparison, or
    not OPTAB_DIRECT, but I think none of that applies to ce3, we punt on
    BLKmode earlier, use OPTAB_DIRECT and shouldn't be comparing two
    VOIDmode CONST_INTs.

    2022-01-21  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/102478
            * optabs.cc (prepare_cmp_insn): If !can_create_pseudo_p (), don't
            force_reg constants and for -fnon-call-exceptions fail if
copy_to_reg
            would be needed.

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


More information about the Gcc-bugs mailing list