public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Richard Biener <rguenther@suse.de>
Cc: Uros Bizjak <ubizjak@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Jeff Law <jeffreyalaw@gmail.com>
Subject: Re: [PATCH v2] combine: Fix ICE in try_combine on pr112494.c [PR112560]
Date: Thu, 7 Mar 2024 11:36:59 -0600	[thread overview]
Message-ID: <20240307173659.GH19790@gate.crashing.org> (raw)
In-Reply-To: <2737spr1-459p-3oon-n852-qn034s55p66r@fhfr.qr>

On Thu, Mar 07, 2024 at 10:55:12AM +0100, Richard Biener wrote:
> On Thu, 7 Mar 2024, Uros Bizjak wrote:
> > 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)

No.  It has established *this is the case* some time earlier.  Lines\
3155 and on, what begins with
  /* Many machines have insns that can both perform an
     arithmetic operation and set the condition code.

> > OK for trunk?
> 
> Since you CCed me - looking at the code I wonder why we fatally fail.

I did not get this email btw.  Some blip in email (on the sender's side)
I guess?

> The following might also fix the issue and preserve more of the
> rest of the flow of the function.

> --- a/gcc/combine.cc
> +++ b/gcc/combine.cc
> @@ -3182,7 +3182,8 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn 
> *i1, rtx_insn *i0,
>  
>        if (undobuf.other_insn == 0
>           && (cc_use_loc = find_single_use (SET_DEST (newpat), i3,
> -                                           &cc_use_insn)))
> +                                           &cc_use_insn))
> +         && COMPARISON_P (*cc_use_loc))

Line 3167 already is
      && GET_CODE (SET_SRC (PATTERN (i3))) == COMPARE
so what in your backend is unusual?


Segher

  parent reply	other threads:[~2024-03-07 17:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  9:16 Uros Bizjak
2024-03-07  9:55 ` Richard Biener
2024-03-07 10:11   ` Uros Bizjak
2024-03-07 10:22     ` Richard Biener
2024-03-07 17:44       ` Segher Boessenkool
2024-03-07 10:37     ` Jakub Jelinek
2024-03-07 10:45       ` Richard Biener
2024-03-07 11:22         ` Uros Bizjak
2024-03-07 17:51           ` Segher Boessenkool
2024-03-07 17:49         ` Segher Boessenkool
2024-03-07 10:57       ` Uros Bizjak
2024-03-07 17:36   ` Segher Boessenkool [this message]
2024-03-07 21:04     ` Uros Bizjak
2024-03-07 21:08       ` Uros Bizjak
2024-03-07 21:35       ` Segher Boessenkool
2024-03-07 22:07         ` Uros Bizjak
2024-03-07 22:27           ` Segher Boessenkool
2024-03-07 22:46             ` Uros Bizjak
2024-03-18 14:49               ` Segher Boessenkool
2024-03-18 15:44                 ` Uros Bizjak
2024-03-07 22:27           ` Uros Bizjak
2024-03-18 14:44             ` Segher Boessenkool
2024-03-18 15:29               ` Uros Bizjak

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=20240307173659.GH19790@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=rguenther@suse.de \
    --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).