public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "stefansf at linux dot ibm.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
Date: Wed, 02 Aug 2023 09:05:52 +0000	[thread overview]
Message-ID: <bug-110869-4-UoJI4SXZmf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110869-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
For sparc we already see some sort of pre-optimization which "breaks" the new
test cases.  For example, for test cmp-mem-const-1.c we have prior combine:

(insn 14 13 41 2 (set (reg:SI 117)
        (ior:SI (reg:SI 118)
            (const_int 1023 [0x3ff]))) "cmp-mem-const-1.c":10:13 307 {iorsi3}
     (expr_list:REG_DEAD (reg:SI 118)
        (expr_list:REG_EQUAL (const_int 1073741823 [0x3fffffff])
            (nil))))

(insn 41 14 42 2 (set (reg:CC 100 %icc)
        (compare:CC (reg:SI 117)
            (reg:SI 116 [ *x_2(D) ]))) "cmp-mem-const-1.c":10:13 1
{*cmpsi_insn}
     (expr_list:REG_DEAD (reg:SI 117)
        (expr_list:REG_DEAD (reg:SI 116 [ *x_2(D) ])
            (nil))))

where the 64-bit constant 0x3fffffffffffffff already got chopped into a 32-bit
constant 0x3fffffff.  Thus in combine we only see

narrow comparison from mode SI to QI: (MEM leu 0x3fffffff) to (MEM leu 0x3f)

whereas I have been pretty strict in the new tests and demanded to see a 64-bit
constant:

scan-rtl-dump "narrow comparison from mode DI to QI" "combine"

Thus one solution would be to not consider the source mode by using

scan-rtl-dump "narrow comparison from mode .I to QI" "combine"

This would solve test cases cmp-mem-const-{1,2,3,4}.c.  For cmp-mem-const-{5,6}
we have that the pre-optimization already chopped the 64-bit constant into a
32-bit constant and thus leaves us with nothing to do here.  I'm not entirely
sure how we handled such cases in the past.  Though, one solution would be to
simply exclude sparc from this test:

/* { dg-do compile { target { lp64 } && ! target { sparc*-*-* } } } */

Would that be ok?

  parent reply	other threads:[~2023-08-02  9:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 16:26 [Bug middle-end/110869] New: " ro at gcc dot gnu.org
2023-08-01 16:27 ` [Bug middle-end/110869] " ro at gcc dot gnu.org
2023-08-01 18:20 ` pinskia at gcc dot gnu.org
2023-08-01 19:58 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-02  7:40 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-02  9:05 ` stefansf at linux dot ibm.com [this message]
2023-08-02  9:17 ` ro at gcc dot gnu.org
2023-08-02  9:50 ` ebotcazou at gcc dot gnu.org
2023-08-02 14:05 ` stefansf at linux dot ibm.com
2023-08-02 19:44 ` cvs-commit at gcc dot gnu.org
2023-08-04  7:53 ` ro at gcc dot gnu.org
2023-08-04  7:53 ` ro at gcc dot gnu.org
2023-08-04  8:38 ` stefansf at linux dot ibm.com
2023-08-04  8:40 ` stefansf at linux dot ibm.com
2023-08-04  8:51 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-04  9:42 ` stefansf at linux dot ibm.com
2023-08-04 14:16 ` stefansf at linux dot ibm.com
2023-08-04 14:18 ` stefansf at linux dot ibm.com
2023-08-07 12:29 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-07 13:41 ` stefansf at linux dot ibm.com
2023-08-08  6:54 ` cvs-commit at gcc dot gnu.org
2023-10-02  5:23 ` xry111 at gcc dot gnu.org
2023-10-02  5:24 ` xry111 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-110869-4-UoJI4SXZmf@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).