public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] combine: Fix ICE in try_combine on pr112494.c [PR112560]
Date: Wed, 29 Nov 2023 13:25:36 +0100	[thread overview]
Message-ID: <CAFiYyc2vGGOcdmS-fbPs=xe0L8kgytRtodHqip--Ra7+V2ue4w@mail.gmail.com> (raw)
In-Reply-To: <CAFULd4Zboqhmv=BUHoKJfRaT9YfNbg5OwsPuUsMyW-dbsr2M5g@mail.gmail.com>

On Wed, Nov 29, 2023 at 10:35 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>
> The compiler, configured with --enable-checking=yes,rtl,extra ICEs with:
>
> internal compiler error: RTL check: expected elt 0 type 'e' or 'u',
> have 'E' (rtx unspec) in try_combine, at combine.cc:3237
>
> This is
>
> 3236              /* Just replace the CC reg with a new mode.  */
> 3237              SUBST (XEXP (*cc_use_loc, 0), newpat_dest);
> 3238              undobuf.other_insn = cc_use_insn;
>
> in combine.cc, where *cc_use_loc is
>
> (unspec:DI [
>         (reg:CC 17 flags)
>     ] UNSPEC_PUSHFL)
>
> combine assumes CC must be used inside of a comparison and uses XEXP (..., 0)
> without checking on the RTX type of the argument.
>
> Skip the modification of CC-using operation if *cc_use_loc is not COMPARISON_P.
>
>     PR middle-end/112560
>
> gcc/ChangeLog:
>
>     * combine.cc (try_combine): Skip the modification of CC-using
>     operation if *cc_use_loc is not COMPARISON_P.
>
> Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
>
> OK for master?

Don't we need to stop the attempt to combine when we cannot handle a use?
Simply not adjusting another use doesn't look correct, does it?

Richard.

>
> Uros.

  reply	other threads:[~2023-11-29 12:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29  9:34 Uros Bizjak
2023-11-29 12:25 ` Richard Biener [this message]
2023-11-29 13:20   ` Uros Bizjak
2023-11-30  8:18     ` Segher Boessenkool
2023-11-30  9:09       ` Uros Bizjak
2023-12-04  9:34   ` Uros Bizjak
2023-12-07 12:09     ` Richard Biener

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='CAFiYyc2vGGOcdmS-fbPs=xe0L8kgytRtodHqip--Ra7+V2ue4w@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ubizjak@gmail.com \
    /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).