public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/105192] ICE: in gen_reg_rtx, at emit-rtl.cc:1167 (during RTL pass: ce3) with -O -fno-if-conversion -fharden-compares
Date: Wed, 16 Nov 2022 20:09:55 +0000	[thread overview]
Message-ID: <bug-105192-4-xFtdi0wqCJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105192-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-11-16
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Something like this might fix the issue:
apinski@xeond:~/src/upstream-gcc/gcc/gcc$ git diff config/mips/mips.md
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index e0f0a582732..3419f4df307 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -1217,7 +1217,7 @@ (define_expand "ctrap<mode>4"
                            [(match_operand:GPR 1 "reg_or_0_operand")
                             (match_operand:GPR 2 "arith_operand")])
            (match_operand 3 "const_0_operand"))]
-  "ISA_HAS_COND_TRAPI || ISA_HAS_COND_TRAP"
+  "can_create_pseudo_p () && (ISA_HAS_COND_TRAPI || ISA_HAS_COND_TRAP")
 {
   mips_expand_conditional_trap (operands[0]);
   DONE;

I have no way to test it though.
But what is happening from the backtrace and where the assert is:
* the post-reload ifcvt is detecting a conditional trap and the mips backend
didn't expect any post-reload (really !can_create_pseudo_p ()) detection of a
condtional trap happening so it thought it could use force_reg (which might
create a new pseudo register).

      reply	other threads:[~2022-11-16 20:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  7:02 [Bug rtl-optimization/105192] New: " zsojka at seznam dot cz
2022-11-16 20:09 ` pinskia at gcc dot gnu.org [this message]

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-105192-4-xFtdi0wqCJ@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: link
Be 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).