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 target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
Date: Thu, 14 Apr 2022 11:48:29 +0000	[thread overview]
Message-ID: <bug-105247-4-vpaeQoDgR0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105247-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:ba2f60499dd4a3bc1bb4e99fa12dda3bc1548519

commit r12-8158-gba2f60499dd4a3bc1bb4e99fa12dda3bc1548519
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Apr 14 13:47:34 2022 +0200

    simplify-rtx: Don't assume shift count has the same mode as the shift
[PR105247]

    The following testcase ICEs on ia64.  It is UB at runtime, but we shouldn't
    ICE on it...
    The problem is that on ia64, the shift count (last operand of ASHIFT etc.)
    is promoted to DImode (using zero-extension), while most other targets
    use much narrower modes (say QImode).  If we try to simplify a shift
    and the shift count is CONST_INT or other VOIDmode integer constant
    which isn't properly sign extended for the first operand's mode
    (in the testcase the shift count is 0xfffffff8U and it is a SImode shift),
    then we ICE during wide_int wop1 = pop1; in the first hunk, INTVAL ==
0xfffffff8U
    is not valid for SImode.  I think in theory we could run into this even
    on other targets, say if they use SImode or HImode shift counts for e.g.
    QImode shifts.  I hope word size is the upper bound of what a reasonable
    target should use, using e.g. multiple registers for the shift count is
    insane, so the following patch if op1 has VOIDmode and int_mode
    is narrower than word uses word_mode for extraction of the value.

    2022-04-14  Jakub Jelinek  <jakub@redhat.com>

            PR target/105247
            * simplify-rtx.cc (simplify_const_binary_operation): For shifts
            or rotates by VOIDmode constant integer shift count use word_mode
            for the operand if int_mode is narrower than word.

            * gcc.c-torture/compile/pr105247.c: New test.

  parent reply	other threads:[~2022-04-14 11:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
2022-04-13  5:26 ` [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f marxin at gcc dot gnu.org
2022-04-13  5:26 ` marxin at gcc dot gnu.org
2022-04-13  6:37 ` rguenth at gcc dot gnu.org
2022-04-13 11:11 ` jakub at gcc dot gnu.org
2022-04-13 11:17 ` jakub at gcc dot gnu.org
2022-04-14 11:48 ` cvs-commit at gcc dot gnu.org [this message]
2022-04-14 12:02 ` [Bug target/105247] [11 " jakub at gcc dot gnu.org
2022-04-21  7:51 ` rguenth at gcc dot gnu.org
2023-05-29 10:06 ` 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-105247-4-vpaeQoDgR0@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).