public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/97487] [8/9 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977 Date: Tue, 20 Apr 2021 23:32:01 +0000 [thread overview] Message-ID: <bug-97487-4-ODVcrGUL3j@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-97487-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97487 --- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:e55dc66ddefebef79f8d733ba6eb835c7b52d7ec commit r9-9415-ge55dc66ddefebef79f8d733ba6eb835c7b52d7ec Author: Jakub Jelinek <jakub@redhat.com> Date: Wed Feb 3 09:09:26 2021 +0100 ifcvt: Avoid ICEs trying to force_operand random RTL [PR97487] As the testcase shows, RTL ifcvt can throw random RTL (whatever it found in some insns) at expand_binop or expand_unop and expects it to do something (and then will check if it created valid insns and punts if not). These functions in the end if the operands don't match try to copy_to_mode_reg the operands, which does if (!general_operand (x, VOIDmode)) x = force_operand (x, temp); but, force_operand is far from handling all possible RTLs, it will ICE for all more unusual RTL codes. Basically handles just simple arithmetic and unary RTL operations if they have an optab and expand_simple_binop/expand_simple_unop ICE on others. The following patch fixes it by adding some operand verification (whether there is a hope that copy_to_mode_reg will succeed on those). It is added both to noce_emit_move_insn (not needed for this exact testcase, that function simply tries to recog the insn as is and if it fails, handles some simple binop/unop cases; the patch performs the verification of their operands) and noce_try_sign_mask. 2021-02-03 Jakub Jelinek <jakub@redhat.com> PR middle-end/97487 * ifcvt.c (noce_can_force_operand): New function. (noce_emit_move_insn): Use it. (noce_try_sign_mask): Likewise. Formatting fix. * gcc.dg/pr97487-1.c: New test. * gcc.dg/pr97487-2.c: New test. (cherry picked from commit 025a0ee3911c0866c69f841df24a558c7c8df0eb)
next prev parent reply other threads:[~2021-04-20 23:32 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-19 9:28 [Bug middle-end/97487] New: [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 asolokha at gmx dot com 2020-10-19 9:47 ` [Bug middle-end/97487] " rguenth at gcc dot gnu.org 2020-10-19 12:13 ` [Bug middle-end/97487] [10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r10-1420-g744fd446c321f78f marxin at gcc dot gnu.org 2020-10-19 17:57 ` jakub at gcc dot gnu.org 2020-10-20 8:13 ` [Bug middle-end/97487] [8/9/10/11 Regression] ICE in expand_simple_binop, at optabs.c:939 since r8-3977 jakub at gcc dot gnu.org 2021-01-14 9:26 ` rguenth at gcc dot gnu.org 2021-02-01 16:45 ` jakub at gcc dot gnu.org 2021-02-03 8:10 ` cvs-commit at gcc dot gnu.org 2021-02-03 8:12 ` [Bug middle-end/97487] [8/9/10 " jakub at gcc dot gnu.org 2021-03-19 23:28 ` cvs-commit at gcc dot gnu.org 2021-03-20 8:06 ` [Bug middle-end/97487] [8/9 " jakub at gcc dot gnu.org 2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org [this message] 2021-04-22 16:50 ` cvs-commit at gcc dot gnu.org 2021-04-22 17:07 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-97487-4-ODVcrGUL3j@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).